07-24-2015 09:56 AM
07-24-2015 10:08 AM
mnanda98 wrote: Based on the sequence number I want to use a flat sequence structure to send the commands to my motor controller in the right order.
No you don't. You want to use a FOR loop with autoindexing tunnel. First of all, you will want your sequence number to be the first item. Then you have an array of motor clusters. You can then just use Sort 1D Array to get the order correct. Then you autoindex on that array with your FOR loop to send the commands.
07-24-2015 10:16 AM
07-24-2015 10:46 AM - edited 07-24-2015 10:47 AM
Maybe this will clear it up...
07-24-2015 04:14 PM
The reason Crossrulz said to put the Sequence # first in your Cluster is because sorting starts with the first element, then the second, etc. If, however, you require that the Sequence number be, say, the third element, you can still sort it by using a trick (only do this if the array of clusters isn't huge) -- create a temporary cluster whose first element is the Sequence # and whose remaining element is the entire cluster. An array of these things will sort on the first element. Once sorted, take the Cluster apart and return only the second element, your original Cluster, now sorted. [I hope that was clear ...]
Bob Schor
07-24-2015 06:18 PM
Hello, thank you both for your help - that makes more sense now. Crossrulz, I was trying to replicate your example but was not able to find what you used on your block diagram? How should I proceed from here? Any help would be appreciated, thank you.
07-24-2015 06:24 PM
Nevermind - I figured it out! Thank you all for your help
07-24-2015 07:27 PM
Hi sorry one more question.. Now I am trying to use my cluster inputs instead of wiring the constants and am very stuck. Here is what I have so far..
07-24-2015 07:57 PM
Try posting your VI rather than an image - especially an image of your message. It is much easier for us to debug a VI than an image.
Lynn
07-24-2015 08:12 PM
My mistake, I posted it in a hurry.. Here is the attached vi: