LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting the measured sensor data between Button on and Button off as array

Solved!
Go to solution

Dear all,

 

I have simple problem but I'm stuck. Programming is not my strongest point, I'm noob in LabView, and there is a huge time pressure and I don't get it, probably from stress too.

I have a sensor reading out data continuously. It is one of the many measurements. But the change in this data is important, so it needs to be recorded in a time interval, unlike the others.

A bigger while loop is running already with all the systems.

I can record it, make an array inside growing each time with a new measurement via shift register. But I just can't stop the while loop with the Boolean and extract that array. I need that array with large amount of data points to write into measurement file afterwards, as TDMS. I'll investigate the signal behavior.

 

It might sound stupid but I'm working on it for two days. I've read ten's of threads, tried many examples, tried BooleanPtByPt, or other things. This is how I came to this point. But I can't figure out the rest.

 

Please help me,

I'd be very thankful if you could help.

0 Kudos
Message 1 of 5
(2,414 Views)
Solution
Accepted by topic author heinasirkka

We're missing quite a bit of context here. But a few of the problems are clear.

 

The boolean's value is read when the loop begins,and that value is passed to the loop. Inside the loop, it will never change.

Boolean on off.PNG

I hope this leads you towards a quick fix of the problem.

 

There are probably more structual changes needed if the program keeps growing.

Message 2 of 5
(2,315 Views)
Solution
Accepted by topic author heinasirkka

As already mentioned by , your buttons are not correctly placed.

But you can still use local variable, and the buttons will be read even if the buttons are not in the executed loop.

 

Also I would like to say, if you need fast measurements, place your array indicator outside of while loop, where your read your sensor. This way your loop will be faster, because indicator will not get refreshed every iteration when you read from sensor.

 

BR, Jakob

Message 3 of 5
(2,310 Views)

You are godsent, thank you so much! 

Local variable was the trick I couldn't figure out.

Message 4 of 5
(2,301 Views)

thank you so much for the suggestion. It works!!
I wish you all a nice day

0 Kudos
Message 5 of 5
(2,300 Views)