Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

SortIng by arbitration ID

I am using Frame API with 2 PXI chassises and a cRIO.  I want to send 4-5 frames of informatin through CAN.  I'm having no trouble getting the communication to work, but I am having issues processing the information on the receiving end.  I want to extract the data from all of the frames and store it in an array.  Order is important though.  The way I have it now, the data just goes into the arry in whatever order it happens to come in.  Is there some way to sort the frames by their arbitration ID to avoid this problem?  I've attatched some of my code.  It is a modified version of an example VI.
0 Kudos
Message 1 of 5
(4,149 Views)
Hello,
 
It sounds like you need to sort the rows of the 2D string array returned by the CAN Receive example based on the arbitration ID.  I have attached an example with will perform an insertion sort on a 2D string array... sorting the rows based on the values in a chosen column (for you this is index 1 to specify column 2 for the IDs).
 
I hope this helps!
 
Best Regards,
 
JLS
Best,
JLS
Sixclear
Message 2 of 5
(4,139 Views)
Thanks for the help.  Could you include the Row-Swap 2D String Arrary.vi?
0 Kudos
Message 3 of 5
(4,132 Views)

Oops 🙂

You'll need the attached subVI as well... it's used in the VI I attached in the previous post above 🙂

Best Regards,
 
JLS
Best,
JLS
Sixclear
0 Kudos
Message 4 of 5
(4,129 Views)
Ok, you must have posted just before I did... I didn't see your post until after 🙂
 
In any event, I hope it helps!
 
Best Regards,
 
JLS
Best,
JLS
Sixclear
0 Kudos
Message 5 of 5
(4,127 Views)