LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CANBus occurence

We use CAN bus to communicate with a device under test.
After receiving a number of frames (5) we have to answer within a specified time.
First, we are setting the number of frames using the VI ncSetAttr.vi. Then, we are waiting for the occurence using the VI ncCreateOccur.vi. After the occurence is generated we will read the received frames. So far, this is working fine, but sometimes the occurence is generated we will only read one or zero frames.
A crosscheck was done with the VI ncWait.vi. This VI will work everytime, but will use 100% of CPU time. This is not acceptable for our project, because we have to do a lot of other things in parallel.
Does someone have an idea, who to come to an solution?

Regards
Heinrich
0 Kudos
Message 1 of 2
(2,498 Views)
Heinrich,
I think there could be several reasons why you are not receiving the expected number of frames. Firstly, check you are not receiving any errors or warnings. The NI-Can cards do sometimes lose messages if multiple frames are received in quick succession as the cards are unable to keep up with the dataflow. Also, could you be reading the frames elsewhere in the program?
One other possibility could be that either your bit mask in ncCreateOccur.vi may be incorrect and an occurence is being generated for another reason, and you may want to consider using the Iteration input to improve reliability. It does appear possible that occurrences may be falsely generated if this is not wired.

Hope this helps.
Andy
0 Kudos
Message 2 of 2
(2,498 Views)