10-19-2010 02:55 PM
Hi all,
I am working on code that would read multiple CAN messages in parallel. I read a group of four inputs outputting values on the CAN bus. Once the first group is finished I turn them off and turn on the next four inputs. When I read in the next group of messages I am getting values from the first group of inputs. I have verified the values have changed via a CAN bus monitor a colleague has created. I am using the ncGetAttr.vi using Read entries pending. My guess is the CAN messages are logging and when it comes time for my second test I am reading the pending messages from the test before. So my question is if there is a way to clear the pending messages before the next time I use the Read entries pending with the ncGetAttr.vi? I have searched in the example codes and in a few other places throughout ni.com with no help. Please help.I will be trying everything I can to solve this myself. Thanks.
Solved! Go to Solution.
10-20-2010 03:51 PM
Hi Branderergg,
Have you tried the ncAction VI? You could send the CAN Object Reset action which clears all entries from the read and write queues. You can find more information on page 10-7 of the NI-CAN Hardware and Software manual.
10-20-2010 03:59 PM
Thanks for your help but i found a solution that is very similar to this at least does the same action. I have a CAN filter.vi I created to filter the CAN bus for the arbitration ID I am reading and I put this in between my CAN reading sub VIs and it cleared the problem. This makes sense because the CAN filter.vi stops the CAN bus sets the filters and restarts the CAN bus. Thanks for the input though I will look into the Reset vi .