08-28-2006 03:05 AM
Hello
In one of our application we have to communicate with an encoder .This encoder supports CANopen protocols.Please find the attached encoder specifications.
For this we are using PCMCIA-CAN/2 card.
As far as i know, for CANopen protocols we should have CANopen library.
Is this CANopen library comes with the card itself or we have to purchase it ??
Can we communicate with encoder using VIs that comes with NI CAN 2.3.2 ??
Please reply as soon as possible.
Regards
R
08-28-2006
08:08 AM
- last edited on
02-16-2025
05:30 PM
by
Content Cleaner
Hi,
The easiest way is to use the CANopen Library for LabVIEW together with one of our CAN boards. You can purchase the Library independently, but it only works with NI CAN boards.
Because CANopen is based on CAN, you should be able to read the messages comming from the sensor using the NI CAN Frame API. But to communicate with CANopen it needs some special IDs and commands, which you have to create by your own.
DirkW
09-21-2006 07:26 AM
Hi
DirkW
Thanks for reply and sorry for delay from my side.
We had purchased NI PCMCIA-CAN/2 card. Since i have to communicate to the encoder. So I have to read the encoder output.
Now i am not able to start the communication.Please help how to start.
I am also not able to understand the SDO and PDO concepts like what is the meaning of SDO and PDO
when to use SDO ,when to use PDO
Please explain on this issue.
Thanks
R
09-22-2006 11:03 AM
Hi,
Well the CANopen Library should bring a lot of theoretical stuff about CANopen in general and PDO and SDO in particular. The help is integrated into the LabVIEW help and if you search the Help for PDO you should find something.
A Part of the installer as well are some examples for CANopen communication. See the attached aanalog input example, which shows how to talk to a CANopen slave device using remote requests. This example is sending a request every second and receives a PDO answer. It is written to receive 4 16 bit values but you should be able to modify the data types.
I guess this should work with your sensor because he is able to works this way.
If it isd not working, try to get a manual for the sensor and post it to the forum, thus i can have a look to it.
DirkW
09-23-2006 01:42 AM
09-25-2006 08:44 AM
Hi,
There is something wrong in your code or network configuration. The error message means there is allready a handle open for the device you try to use.
Take care to have only one handle open to your CAN port, you try to use with CANopen.
Before you try to use CANopen, check the Bus whether or not the sensor is communicatiing. Connect the sensor to the CAN board and open the MAX (Measurement and Automation Explorer) Make a right click to the CAN poirt your sensor is connected to and open the Busmonitor. Is there any communication going on. If not try different baudrates.
You can change the baudrates if you close the busmonitor and choose properties from the context menue instead of busmonitor.
Are you sure the sensor is working with 125kbaud and node Id 1? Is there any manual for the sensor besides the datasheet you posted twice.
DirkW
09-29-2006 06:24 AM
09-29-2006 08:56 AM
Hi,
Try the attached example, which enables asynchron cyclic transmission of position values for your sensor and reads them.
If this doesn't work check Node ID and BaudRate.
DirkW
10-06-2006 12:56 AM
Hi
Still i am not able to establish the communication.
Can you tell the steps involved in establishing (Loke initialization etc) the communication.
I have to read the counts value from the sensors.
In the example given by you , CANopen Module Control . VI you have mentioned the Node ID - 0 &
in CANopen SDO create.vi you have mentioned the Node ID - 1 . Is there any difference between these two IDs or these should be same.
What is the difference between - COB ID , Node ID and Arbitration ID ??
Please reply as soon as possible
Thanks and Regards
J
10-06-2006 08:50 AM
Hi
Did you get any error message? Have you tried to spy the raw frame transfer on the bus using the bus monitor?
Is the SDO running into a timeout?
The difference between these three terms is the following. The arbitration ID is the message ID and specifies the priority for this message (0-highest priority).
The node ID is the ID for your canopen device, mostly configurable using swityches.
The COB ID is calculated from message ID and node ID using basic identifiers from CANopen within a formula: COB ID = SDO ID (1537) - 1 + Node ID = 1537 (SDO for NodeID 1).
DirkW