From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Speed up unpack of data

I am working on a good way to unpack data from a test event.  I unfortunately don’t have the ability to control the format that the data is common up from the RT in, so I need to come up with an efficient way to deal with a array of clusters which can change based on the type defs.  My current problem is that it takes about 4 minutes to unpack 15000 samples (that’s a 15 second test event).  I also need to keep them in the same order that the controls in the cluster appear because I to be able to display them in a waveform graph based on ring values which are pulled from the single same type def in much the same way as the data is pulled out.   

 

 

Attached is a test vi I am working with.  If anybody can find a better way to get the data out that would be helpful.  

 

Thanks

0 Kudos
Message 1 of 4
(2,214 Views)

Hi tsk,

 

the slow part is where the same cluster is parsed over and over again: you should try to make a list of needed conversions from the typedef and the iterate over the array using this list. This would also eliminate the data copying into the value property node...

 

The RT developer should get clubbed for that typedef Smiley Wink

 

Another idea:

Once you have a list of needed conversions you could typecast a cluster (array element) into array of U8 to pick up the single elements...

 

Btw. your time measurement is flawed...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(2,202 Views)

Of course your timing measurment is highly flawed. It will not work as expected.

 

 

When the VI starts, the "get date/time" on the right will execute immediately, concurrently with the first frame of the sequence (and thus with the left "get time/date"). The time difference you measure is small and random and has nothing to do with the execution time of the second frame that you are trying to measure.

0 Kudos
Message 3 of 4
(2,195 Views)

I will try that conversion trick, I am not sure how else to unpack the cluster as it doesn’t want to turn into an array. 

 

I agree, but my boss informs me that clubbing people in the workplace is frowned upon. The data was originally sent up as three arrays of doubles, integers and Booleans. Each array had an associated type def which indicated what channel the data came from, it was beautiful, but alas.

 

I am not all that familiar with picking single elements like that, do you know of a good article to get me started?

 

yes yes, I realized that after I posted it.  

0 Kudos
Message 4 of 4
(2,189 Views)