LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XNET Read CAN Frame

Hey guys,

 

I'm working on a project using a NI cDAQ 9034 chassis and NI 9862 CAN module to communicate with my frequency inverter, which uses the CANopen protocol.

 

Using the examples given by NI I was able to send SDO's using a (Frame) Stream Output Session.

 

My inverter sends its status word once every 250ms with the identifier 0x1A0 and the answer to my parameter communication SDO with the identifier 0x5A0 a 100ms after sending the SDO.

It also sends some current data every 5ms with the identifier 0x520.

 

Also using the examples, I have managed to read the data sent from my inverter as a (Frame) Stream Input Session.

The problem I am facing now is that my input session reads the data from every identifier. My front panel mostly shows the data sent over ID 0x520 since it has the highest frequency, but it 'flickers' when the other data is being read and you can see that the values change for a split second.

 

How can I read the data sent over each ID seperately so that I can further work with it and save it?

 

 

Thanks in advance for any help!

0 Kudos
Message 1 of 5
(5,629 Views)

Try looking at the different session types. I think Frame Input Queued may be what you are looking for.

Matt J | National Instruments | CLA
0 Kudos
Message 2 of 5
(5,615 Views)

Unbundle the ID from the CAN frame and wire it to a case structure and put your indicator inside the case structure. This means the indicator will only update when the CAN frame with the appropriate ID comes in.

 

CAN Filter.PNG


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 3 of 5
(5,609 Views)

Thanks for your help! I'm new to LabVIEW so it took me some time to get that done.

 

It's looking better now and I can read each ID seperately.

Unfortunately, the status word and the answer to my sent frame do not always get updated as frequently as they are sent.

My status word seems to be updated correctly as soon as I turn my electric motor on, causing the status word to be sent every 100ms instead of every 250ms.

The answer to my sent frame seems to be read randomly. Sometimes every few ms and sometimes not for minutes.

 

Could this have to do with the sending of the frames?

I used the 'CANFrame Output Stream (Session)' VI from the examples.

0 Kudos
Message 4 of 5
(5,567 Views)
Can you post your VI? Have you checked/verified the timing of the frames being sent/received (e.g. using a CAN sniffer)?

LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 5 of 5
(5,560 Views)