LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create an array of 16 * 16 with information that I read from the card

hi,

I have a state machine that reads  information from my device.
I need to build a array of 16 * 16 with the data that i received.
I can not understand how I build such a system in my state machine.
I know how to build array of 16 * 16.
The question is: How do I build such an array with my data in the state machine.
I attach the files of the state machine and array.

Download All
0 Kudos
Message 1 of 17
(4,272 Views)

Hi Fnachum

 

using the most recent LabVIEW version will often decrease the chance other people are able to open your VIs… (Me too right now.)

 

Can you describe the scheme needed to put the information in your 16×16 array? Once you can describe it with words it should be possible to create code for it!

 

 

Best regards,
GerdW


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

I have an array of sensors 16 * 16 in my card.
Every time I read another sensor.
And the information obtained from the sensor I need to store an array of 16 * 16 to display the result of all the sensors in a graph.
In state machine I take a different sensor in a row.
After I took the information from the 16 sensors , I move to the next line.
Every line I have 16 sensors and 16 rows.

By one of the state machine is to read the data from the sensor.

After selecting the sensor reading (row and column), I read the information.

0 Kudos
Message 3 of 17
(4,254 Views)

Hi Fnachum,

 

- initialize an array with 16×16 elements.

- when you read a sensor you replace the according element in the array with the new sensor value.

 

You will need a shift register and a ReplaceArraySubset node…

Best regards,
GerdW


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

Fnachum,

 

It's hard to follow your sentences. 

 

I assume you have 16x16 sensors arranged in 2D fashion and each time you can read only one row of data from hardware.  ie., 16x1.  The you need to build it up to 16 rows to cover all sensors.  Is that correct?

 

You can downgrade your VI to older LabVIEW version by going through File-->Save for Previous version.  Downgrade it to LabVIEW2010 or LabVIEW 2012 which most people can have a look at and help you.

 

-Ajay.

--
Ajay MV


0 Kudos
Message 5 of 17
(4,245 Views)

Every time I read one sensor I make 256 calls 16 * 16.
I attach the files to be older version 12

Download All
0 Kudos
Message 6 of 17
(4,231 Views)

Hi Fnachum,

 

THINK DATAFLOW!

- Use (more) shift registers: whenever you need data in each state of your state machine you should put that data in a shift register! (MUX, DEC, End, ...)

- Bundle your data in a cluster so you only need one shift register to handle all data!

And as said before: put the sensor data in a 2D array using ReplaceArraySubset!

 

Hints:

- I would keep MUX and DEC as an integer value in the state machine and only convert to boolean array when calling the DAQAssistent.

- I would get rid of the DAQAssistents at all and use plain DAQmx functions.

- I would use just one DO task to output all DO values in one go: MUX and DEC use all 8 lines of port 0…

- Why don't you read the data as U8 value? No need to read a boolean array when you convert it to U8 anyway…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 17
(4,219 Views)

Gerd,

 

I have always wondered this (and not to highjack the thread), but why do you an others advise folks to use the DAQmx functions rather than the Assistant? Just curious is all.

 

Eric

0 Kudos
Message 8 of 17
(4,201 Views)

@Eric1977 wrote:

Gerd,

 

I have always wondered this (and not to highjack the thread), but why do you an others advise folks to use the DAQmx functions rather than the Assistant? Just curious is all.

 

Eric


More efficient in the fact that you are not redoing a lot of setup (inside of the drivers).  Easier to see exactly what is happening (do not have to open up a configuration dialog).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 17
(4,197 Views)

Hi Eric,

 

because the DAQAssistent (as other ExpressVIs as well)

- does things usually more complicated then they need to be

- uses the dreaded DDT, hiding the relevant underlying data

- is limited in it's capabilities

- blows up the file size of VIs

- …

 

DAQmx really is very easy - atleast for the things the OP wants to do here…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 17
(4,191 Views)