Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

PCMCIA-CAN/2

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

0 Kudos
Message 1 of 19
(9,111 Views)
 

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

0 Kudos
Message 2 of 19
(9,104 Views)

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

0 Kudos
Message 3 of 19
(9,004 Views)

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

Message 4 of 19
(8,993 Views)
Hi DirkW
thanks for the reply.
I had tried to set the communication with the sensor using attached example (AnalogInput.vi) but i am not able to read.Every time i tried to read it shows error (error code:  -1074388969).
I have attached the datasheet of the sensor for your reference.
For this sensor ,i am giving the voltage externally (12 V) in between pin 9 and 6 (3 & 6 are shorted).
 
i want to read the data send by the encoder. I have set the baude rate of 125 kbps.The nodeID for the sensor is 1.
 
Please solve my problem
it is getting difficult for me
 
Thanks  & Regards
J
 
0 Kudos
Message 5 of 19
(8,980 Views)

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

0 Kudos
Message 6 of 19
(8,966 Views)
hi
please find the attached manual.
I do not know how to start the communication.How to reset the encoder.
Please reply as soon as possible.
 
Thanks
Regards
J
0 Kudos
Message 7 of 19
(8,937 Views)

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

Message 8 of 19
(8,931 Views)

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

 

0 Kudos
Message 9 of 19
(8,892 Views)

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

0 Kudos
Message 10 of 19
(8,883 Views)