12-21-2015 07:24 AM
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.
12-21-2015 07:27 AM
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!
12-21-2015 07:59 AM
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.
12-21-2015 08:08 AM
12-21-2015 08:08 AM
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.
12-21-2015 08:17 AM
Every time I read one sensor I make 256 calls 16 * 16.
I attach the files to be older version 12
12-21-2015 08:29 AM - edited 12-21-2015 08:30 AM
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…
12-21-2015 08:48 AM
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
12-21-2015 08:50 AM
@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).
12-21-2015 08:53 AM - edited 12-21-2015 08:54 AM
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…