01-06-2014 03:40 PM
Hello,
I'm trying to communicate with a Kollmorgen AKD drive via CANopen within LabVIEW and am having difficulty figuring out the formatting. I have the CAN transceive example running and when I turn on the drive and let it boot up, I receive one CAN message, so I'm fairly confident my wiring, baud rate, and basic drive setup are correct.
The LabVIEW example has fields for Arbitration ID and 8 data bytes but I can't get the drive to respond to any messages I try to send. The Kollmorgen CAN manual is here:
Has someone communicated with these AKD drives using CANopen before? If so, can you please give me an example of how to format my data. My eventual goal is to get the motor position and send velocity commands.
Thank you so much in advance!
...Mike
01-07-2014 01:36 PM
Could you give us more information about the CAN message that you manage to receirve?
01-07-2014 02:17 PM
I have been in contact with Kollmorgen, and although the tech I got isn't very familiar with LabVIEW programming, he gave me a macro that a PLC would transmit to the drive to set a velocity. That was extremely helpful because I was able to see the basic formatting of the CAN packet.
Send 601h 8 23h FFh 60h 00h 2Ah 50h FEh 00h // Set target velocity
Send 601h 8 40h FFh 60h 00h 00h 00h 00h 00h // readback
Send 601h 8 43h 6Ch 60h 00h 00h 00h 00h 00h // read velocity
From this, I am able to get that for these commands, the Communication Object Identifier (COB-ID) is 0x601, there is an 8-byte payload, and the 8 bytes follow.
The COB-ID consists of 11 bits.
The 7 least significant bits (bits 0-6) are the drive number (1-127 decimal).
The 4 most significant bits (bits 7-10) are the object function code. To get started, I can use function code "Service Data Object" (SDO) which is 1100 binary.
So, therefore, the COB-ID is the SDO function code + Drive Number which is 1100 + 0000001 = 11000000001 binary = 0x601
Now that the addressing and command type have been entered, the 8 bytes of data that follow make up the command. That's what I'm working on now.
I was hoping that someone had already figured all this out and could share a LabVIEW example for how to communicate to Kollmorgen drives over CAN.
When (if) I get something working, I will post it.
...Mike
01-07-2014 03:30 PM
It sounds like you have a pretty good understanding of the CANopen protocol. Have you tried to access various items in the data dictionary through the use of the CANopen_SDO_Write.vi example that comes with the NI Industrial Communications for CANopen 1.0.3?
01-07-2014 04:52 PM
I would say that no, I don't have a very good understanding of the protocol, I'm just trying to work my way through it (but thanks for the props).
I downloaded the NI Industrial Communications for CANopen 1.0.3 and installed it. Unfortunately when I run CANopen_SDO_Write.vi, I get an error at Interface Create. The default name in there is "CANopen01". I changed it to "CAN1" and still get an error. NI-MAX calls my CAN hardware "CAN1", so I think that is correct. Unfortunately the sub-VIs are locked, so I cannot see how the top level is trying to access my hardware.
I have a cDAQ 9178 chassis with a cDAQ 9862 High Speed CAN module installed. The compatibility guide for the NI Industrial Communications for CANopen 1.0.3 does not list this hardware, so maybe this example is not compatible with cDAQ. In the final machine, I'll be migrating to a PXI chassis, but that doesn't help me right now!
...Mike
01-08-2014 11:46 AM
The Industrial Communications for CANopen 1.0.3 library does require the use of supported CANopen hardware and the 9862 module is not compatible.
It sounds like you are essentially trying to recreate a subset of the CANopen library and have your own CANopen drivers for the 9862. The CANopen standard does operate on top of the CAN protocol and what you are trying to do is certainly possible with the 9862 but it will take a fair amount of effort. Switching to a dedicated CANopen PCI/PXI card and using the standard library may save you a great deal of time.
06-12-2014 08:27 AM
Come to find out, I am indeed just re-creating a small portion of the CANopen library because the NI 9862 module isn't compatible. For my test apparatus, this has actually worked pretty well. Now that my test system has proven itself out, I'll be getting a PXI card to build into the final machine.
I'm attaching my example VI for using a NI 9862 high speed CAN module to communicate with a Kollmorgen AKD motor drive.