04-30-2015 01:50 PM
Hello,
I've got some code which was written with DAQ assistants years ago. I'm trying to use tasks and arrays for my producer now for speed and efficiency, but I'm stumped on one thing.
The consumers were written to have the data in a certain order - there's even a VI in there that selects certain elements and sends them to specific outputs. I previously took care of this with a simple VI that split the dynamic data, wired them to different order terminals, and then set it back to dynamic; Screenshot attached.
Is there a structure like this for array where you can break out all the array elements, reorder them and insert constants, and then put them back into the array? What this ends up feeding is a subvi that's an array builder which converts the DD to array and then reroutes it. Seems almost like what I'm trying to do could be done there, but it's a bit confusing to me.
Thanks in advance.
04-30-2015 02:59 PM
I think I got this. Premature post. If someone could look and compare, that would be great.
04-30-2015 08:36 PM
05-01-2015 08:36 AM
I never looked at that function. I guess I overcomplicated it (or oversimplified it), but I'll give that a look. Anything to clean up this code and make it more efficient.
05-04-2015 11:33 AM
Hi Ralph@NES,
One thing I have done before for this is create a mapping array and a for loop to reorder the elements in your data array. Take a look at the example VI I've attached. If you know exactly where you want everything, you just need to go into the mapping array and set the index destination for the corresponding data. Hope this helps.
Paul C
05-04-2015 01:24 PM
Paul,
I'd love to give that a look. Any chance you can save it for 13? I haven't done my 14 upgrade yet. Thanks in advance...
05-04-2015 02:40 PM
Sure thing, here is the file saved for LabVIEW 2013. Let me know if this helps!