LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Manipulating 2D Array to Emulate DAQ Express Calibration stage

Solved!
Go to solution

Hi there,

It would be great if anyone could help.

Im trying to manipulte a 2D array of data which has been produced (Will be produced programatically but just a constant at the moment) to represent the calibration points of a set of transducers/instruments. The reason I need to manipulate the array is that I need to split the data into sets of 2D arrays which represent each transducer then feed into the linear Interpolate function.

 

I can prove the concept works with just one array 10x2 but not when the array has two data sets, i.e without trying to split the array with a for loop.

 

I am essentially trying to emulate the inbuilt calibration function inherent in DAQ Express but without using DAQ express or allowing people to fiddle with NIMAX to great channels.

 

I have attached my code snippet so far (Should be in LV2014) if any one can help.Snippett.png

Download All
0 Kudos
Message 1 of 4
(2,335 Views)

Hi Alex,

 

I am not sure what you mean by not working when you have 2 data sets, but you can try this to use the Index Array functions to split a 2D array at a specified index:

 

https://forums.ni.com/t5/Example-Programs/Split-2D-array/ta-p/3519515

 

Kind regards,

Kelly

0 Kudos
Message 2 of 4
(2,278 Views)
Solution
Accepted by topic author Alex.902

Hi Alex,

 

to manipulate your 2D data you could try this:

check.png

 

The other part in your snippet also has some quite "funny" code: why do you need to typecast a scalar value to an array? Why not use BuildArray instead?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 4
(2,275 Views)

Hi GerdW

 

Thank you for your reply, your method does indeed work perfectly.

The reason for the type cast is that so far as I understand (which can be extremly lacking) in order to get the Interpolate function to work the "test variable" needs to be in the form of an array, I could use a build array for each but as yet I dont know how many calibration points might be in each array so would have to use a for loop also I would presume?

 

i.e a flow meter might have;

4mA = 0ltrs/min

20mA = 10ltrs/min

But for accuracy on the transducers I might calibrate over 10 points.

 

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