LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling DLL in LabVIEW

Solved!
Go to solution

Well, I'm feeling more and more confused. It seems the question about the C structure was an entirely random poke into the dark, since the CanChannelReadMsg.vi is actually giving you back exactly this data but already split out into the flags and everything.

 

But!!!!!

 

Have you read the description of that VI??

 

-> Reads the next CAN message from the receive FIFO of the channel.

 

Do you know what a FIFO is? Another name for this could be a queue. So your nice device is spewing out several hundred measurements per second, which the CAN interface dutifully receives and puts into a queue and then you go and try to throttle the reading of that queue, since you think you can control the measurment speed in that way!

 

But your device happily continues to spew out data as fast as it likes, you just don't read it as fast, which will of course cause the FIFO slowly (or maybe not so slowly) to fill up. If you would look at the timestamp of each message you would see that they are probably following each other with a few ms interval even if you read only one every second.

 

You have two solutions:

 

1) Ask your device developer if there is a way to control the spewing of measurements in some way. It could be that you can put it into a request/response mode, where you have to issue first a specific command before it returns a new value, or it could be that you have to write into some register to control the actual measurment speed.

 

2) Read those values anyhow as fast as possible and throw away all the readings except one every second.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 41 of 41
(671 Views)