10-30-2009 09:31 AM - edited 10-30-2009 09:39 AM
Heey everyone,
I got a small problem, i made a programm which is able communicate with a spider8 (DAQ). Now im trying to save all the data gained from the spider8 to a TDM-file. Let me explain my programm:
Once i started the programm it goes into a stacked sequence. In this stacked sequence has four sequences (0...3) :
1. it first sets up a measurement,
2. then it starts the measurement,
3. the third sequence is reading the values of the sensors,
4. the fourth and last sequence is closing the measurement.
This stacked sequence continues until i press the stop button. A finished measurement with this programm looks like this: (this is the front panel of the programm)
[IMG]http://i35.tinypic.com/2evrxbl.jpg[/IMG]
Now i want to save that data into an other vi, this other vi saves the data into a tdm-file.
I first made this:
[IMG]http://i38.tinypic.com/34j9280.jpg[/IMG]This is the blockdiagram of the programm, you can see the third stacked sequence (= nr.2) and how i thought it would work to save all the data. I configured the programm so that it only reads 10 values per "loop". Unfortunally the write data vi is programmed to overwrite the data if the file already excist. The write data.vi saves everytime it is called, this is everytime the stacked seqence is in the third sequence. Now my programm only saves every 10 values, then overwrites it with the next 10 values, then again until I pressed stop.
Summary:
The programm will eventually only save the last 10 values.
I want to save all the values, so when i read the saved data it looks just like the chart on the front panel.
I hope that some labview-pros/experts can help me out 😛
Thanks everyone:D!
10-30-2009 09:40 AM
10-30-2009 09:43 AM
10-30-2009 09:45 AM
lol, sorry 😛
Frontpanel=leukers
Blockdiagram=leukers-bd
10-30-2009 09:48 AM
@ harrold, i see what you mean but then i probably still have the same problem.
Altough i will try the statemachine soon, just to see if it gives any difference 😉
10-31-2009 07:59 AM
10-31-2009 09:07 AM
Grasman wrote:This is the blockdiagram of the programm, you can see the third stacked sequence (= nr.2) and how i thought it would work to save all the data. I configured the programm so that it only reads 10 values per "loop". Unfortunally the write data vi is programmed to overwrite the data if the file already excist. The write data.vi saves everytime it is called, this is everytime the stacked seqence is in the third sequence. Now my programm only saves every 10 values, then overwrites it with the next 10 values, then again until I pressed stop.
Summary:
The programm will eventually only save the last 10 values.
I want to save all the values, so when i read the saved data it looks just like the chart on the front panel.
Unless I'm missing something, I have to ask: why don't you just fix the Write Data VI? Such as having an input to provide an option to append rather than overwrite.
11-03-2009 02:36 AM
I wrote a program for the use of 2 sensors: This program is able to read in this 2D-array and create two sub-arrays (both 1D) which contain the data of the sensors. (this vi is also attached to this reply; array-test.vi)
The only problem for this program is that when I want to use it in a different program, the two output arrays don`t reinitialize back to default. This means that when I use the program and the two sub-arrays are made, if I want to use the program after that again the arrays still contain the information from the previous use.My other question is, how do i seperate all the signals (max. 😎 from the 2D-array. This 2D-array gets filled like this:
In this example I`m using 3 channels/sensors, and i programmed the main vi (leukers2.vi) that it reads only 2 values per time.
Colomns:
Row1: 1: Channel0; 2: Channel1; 3:Channel2; 4:Channel0; 5:Channel1; 6:Channel2; 7:Channel0; etc..
Row2: 1: Channel0; 2: Channel1; 3:Channel2; 4:Channel0; 5:Channel1; 6:Channel2; 7:Channel0; etc..
Row3: - - - - - - -
The number of rows depends on the number of values it reads per time, in this case it reads 2 values per time, this means 2 rows per colomn. As you can see the spider8.vi`s first read in values for the first channel (channel0), then for the second, then for the third, and then it repeats itself until i press the stopbutton.
In the vi array-test.vi you can see how I solved this problem with two sensors, maybe you people know how to solve this with more then 2 sensors (max 8 sensors).
Thanks alot everyone!