CAN总线通讯 [英] CAN Bus Communication

查看:92
本文介绍了CAN总线通讯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我正在尝试在储罐计量系统和PC之间创建接口.储罐计量器通过CAT 5具有CANbus.我想编写一个VC ++程序以从储罐读取数据.我在网上搜索支持CAN通信的OCX文件.有人可以帮助我处理这些文件吗?

我只需要将数据从CAN BUS读取到系统中.

Dear All,

I''m trying to create an interface between a Tank Gauging System and PC. The Tank Gauging has a CANbus via CAT 5. I want to write a VC++ program to read data from the Tanks. I surfed the net for OCX file that supports CAN communication.. Can anyone help me with these files?

I just required to read the data from CAN BUS into my system.

推荐答案

CAN需要特定的硬件...

http://www.factorycomm.com/cancards.html [ "CAN Open"有更多定义,它是基于"CAN"的definitley.
"DEVICENET"有更多定义,它也基于"CAN" ...

无论如何,这些现场总线上的物理媒体是相同的...

确保了解拓扑结构,并将电阻器放在总线的开头和结尾...

一个很好的页面,可以获取有关所有这些主题的更多信息:
http://www.can-cia.org/ [ ^ ]

HTH! :thumbsup:
CAN requires specific hardware...

http://www.factorycomm.com/cancards.html[^]

If you want to use a PC to do the job, then I''d recommend you to go and get a prebuilt solution... something like Beckhoff or BR-Automation. You''ll get all the software, libraries and electronic cards needed to do the job.

If you want to go a little more cheap and to implement everything by yourself, then you should think of a card and a small driver and then create all the BUS PROTOCOL by yourself.

"CAN" is the hardware and software specification.
"CAN Open" is a little bit more defined and it is definitley based on "CAN".
"DEVICENET" is a little bit more defined and it is based on "CAN" also...

Anyway the physical media on those field busses is the same...

Ensure that you understand the topology and that you put the resistors at the beginning and at the end of the bus...

A good page to get more information on all those topics: http://www.can-cia.org/[^]

HTH! :thumbsup:


是的,我认为您以前可能已经使用过modbus ... MODBUS只是定义协议的软件规范,并且可以在232或485上工作.另一个故事...

为了使用Beckhoff使其工作,例如,您应该获得CANOpen卡.一旦获得该卡,然后购买并安装TWinCAT,之后,您将能够使用系统管理器来配置该卡.您将能够决定要做什么:使用TWinCAT PLC Control在PC内创建PLC程序,或者使用ADS与VC ++应用程序进行通信...

基于软件的CNC/PLC系统使用分离的层进行工作:

Yep, I thought that you would have worked with modbus previously... MODBUS is only a software spec that defines the protocol and that works on 232 or 485. So this is another story...

In order to get it working using Beckhoff, for instance you should get a CANOpen card. Once you''ve got that card, then buy and install TWinCAT, after that you''ll be able to configure the card using system manager. You will be able to decide what to do: Using TWinCAT PLC Control to create a PLC program inside your PC or using the ADS to communicate with a VC++ application if you want...

The software based CNC/PLC systems out there work using separated layers:

[Physical layer - Electronic cards] - connect the pc to the physical world.
[Configuration layer - System manager] - configure / set up the electronics.
[PLC layer - TWinCAT PLC Control] - up to 4 software logics (virtual PLCs).
[CNC layer - TWinCAT CNC / NCi / PTP] - up to 256 axis controlled in different ways.
[ADS layer - Windows application interface] - the way you will be able to get information into your windows apps.



为了获得ADS,您需要安装TWinCAT,它不是免费的... PLC许可证应该足够,或者可能是CONTROL PANEL许可证(我不确定).

这里的问题是概念的改变:

在MODBUS中工作时,您不需要外部帮助.物理层已经安装到PC中,因此不需要其他材料,只需要软件即可.

在这里,您将需要电子设备,因此需要制造商提供的专有软件,以便能够与它们进行交互.

因此,您将使用电子卡和某些软件将您的物理世界连接到PC,这些软件将充当CANOpen总线中的主/从设备.

检查我发送给您的链接...我不这么认为,但是有可能在第一个链接内您可以找到更便宜的东西.

祝你好运!

PS:CANOpen并不是世界上最简单的现场总线...顾名思义,它确实是开放的,这将使您不止一次头痛...它功能强大,但过于复杂,用电子术语很容易实现...这就是为什么电子制造商仍会去那里(使用较慢的CPU来使总线正常工作的原因...),但是它缺乏几种现代总线功能...



In order to get ADS you need to install TWinCAT and it is not free... a PLC license should be enough, or possibly a CONTROL PANEL license (I''m not sure about that).

The problem here is the concept change:

When you worked in MODBUS you did not needed an external help. The physical layer is already installed into the PC and therefore no extre material is needed, only software.

Here you''ll need electronics and therefore you''ll need the propietary software from the manufacturer to be able to interact with them.

So you''ll have your physical world connected to the PC using electronic cards and some software that will act as a master/slave in the CANOpen bus.

Check the links I sent you... I don''t think so, but it is possible that inside the first link you could find something cheaper.

Good luck!

PS: CANOpen is not precisely the easiest field bus in the world... as it''s name suggests it''s really open, and this will give you more than one headache... it is powerful but way too complicated, it is easy to implement in electronic terms... and this is why electronic manufacturers still go there (slower CPU''s to get the bus working...) but it lacks of several modern busses capabilities...


这篇关于CAN总线通讯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆