Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

CANopen data read and write loops

Hi all

 

Not sure whether my issue will be of any interest to you since I'm using a third party library and a non-NI hardware, but my desperation is too big.

 

Im using LV'18 and this CANopen library to control a motor. I'd call myself okay with LV basics and done data acquisition and such before, also CAN and CANopen are now getting familiar. Unfortunately I'm probably missing some motor controlling essentials. The library itself seems fine and SDO down&uploads are working as I can initialize the motor, and read&write values. I have been using the testCANopen.vi example as a basis.

 

What it is I would like to do is eventually to give the motor an external input that controls the velocity of it (the external input for controlling the velocity comes from NI DAQ box, a few times per second). Also, I would like to monitor several values of the motor and set up a nice UI that shows whats up and log the essential data.

 

The essential events in the BD are "SDO Read", "SDO Write" and "Variant". The goal is to have a loop for the motor target velocity (6042h) with external input value, and several loops for reading (actual value 6044h, torque, voltages, currents etc)  and logging data from the bus. Also, a heartbeat monitor would be nice, but might be too much for now.

 

I've tried several approaches to modifying the BD for my purposes by reworking the events, but nothing seems to work out. I have a serious problem in understanding how the events with "Variant" work (hence my limited LV experience), but the number splits etc. basics are okay. All in all, I'm looking a way to automate the velocity write message and loops with static requests for reading data.

 

I would appreciate any help that you can provide to my case described above.

 

Best regards

Samu

0 Kudos
Message 1 of 1
(2,314 Views)