Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

CANopen

Hi
 
I am using the CANopen software (using LabView 7.0) to control a Electronic Distance Meter (EDM) via a PXI-8461 High-Speed Series 2 CAN,1 Port board.
I cannot get the EDM to change from off-line mode to operational mode. The supplier states a message with COB-ID=0, byte 0=1 and byte 1=Node ID (hardwired in device and set to 1).
 
I download a SDO read/write code posted on this discussion board (by DirkW 9th Feb 2006) and tried these settings without success.
I also tried an EXE file from this discussion board (again by DirkW 31st July 2006), which reads the manufacturer device name using CANopen SDO transfer with no success.
[NOTE: Both routines run OK but generate a timeout error due to no response from the H/W]
 
Anyone have any ideas or suggestions.
 
Many Thanks
IanG 
0 Kudos
Message 1 of 9
(6,934 Views)
Ian,
 
I guess there is something wrong with your baudrate or cable. Are you sure you are using the same baudrate as your EDM does and is your cable a CAN cable with propper termination on both ends (120 ohm)?
The CANopen Library for LabVIEW brings simple examples and at least the SDO example should work.
 
DirkW
0 Kudos
Message 2 of 9
(6,926 Views)
Hi
 
I have checked the baudrate in MAX (set to 125kbps) and within the hardware (EDM) and they are the same. I have also checked the cabled used and the datasheet specifies 120ohm termination.
I think I may have to get the EDM supplier in to confirm it is working properly.
 
Thanks
IanG
0 Kudos
Message 3 of 9
(6,904 Views)
Ian,
 
The CANopen Library  "CANopen Interface Create" VI has a Baudrate input. Your 125 K Baudrate should be specified here.
 
DirkW
0 Kudos
Message 4 of 9
(6,897 Views)

Hi

I had in the NI CANopen "ConfigCANNet.vi" routine the same value of the baudrate (ie 125kbps) as indicated in the MAX setting.

IanG 

 

0 Kudos
Message 5 of 9
(6,891 Views)

Ian,

Could you try to set the second byte to 0. That addresses all devices on your bus and perhaps it works. A second thing is setting the device to preoperational first (first byte h80).

I can not think about something else.

DirkW

0 Kudos
Message 6 of 9
(6,870 Views)

Hi

 

Can I just check the format of the message you are suggesting. Using the SDO read/write code I set the CAN port to CAN0 (which is the location of the device), the baud rate to 125000 bps as is set within the EDM hardware, the mode to "preoperational", the NODE ID to 1 as set within the EDM hardware and the write array as follows:

byte 0(code): 80h, byte1(index): 0, byte2(index): 10h, byte3(sub-index): 0, byte4(data0): 0, byte5(data1): 0, byte6(data2): 0, byte7(data3): 0

Thanks

IanG  

0 Kudos
Message 7 of 9
(6,844 Views)

Ian,

No you need the CANopen Module Control.VI with parameter "0" for all nodes and parameter "enter pre-operational". Thats it.

 Call this Vi directly after your CANopen Interface Create VI.

See the PDO.VI Example which comes with the Library for more information.

DirkW

0 Kudos
Message 8 of 9
(6,838 Views)
Having installed the right software (i.e CANopen rather than NI-CAN) and using CANopen Interface Create.vi then CANopen Module Control (with Node ID set to 0 or 1 and the command set to "pre-operational") I still do not get the EDM to switch to an operating mode.
0 Kudos
Message 9 of 9
(6,708 Views)