LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hello!


Can someone please help me out on arrays. I need to get an array of values from the sensor at the user specified moment of the time so that when the order to start gathering data and the order to stop doing it wouldn't affect in any way the main programs performance.
So far I have tried it with the While Loop by placing the data source inside the Loop and the array outside the loop. When the Loop is launched and stoped for the first time, the data is passed over to the array as it should be (but at the same time when the Start is presssed the main program stopes running and will not start running after the Stop is pressed) but when it is started again to get some new values into the array, the work of the main program is still "frozen" and when
the Loop is stoped nothing happens anymore-no new data in the array and the main program is also out.
I have also tried to use array tools such as Initialize Array, Build Array, etc. but didn't succeed because I couldn't get the array to expand by one row every time a new value came in, instead, every new data value replaced the previous value inside the same row.

Anyone, who can help, please, drop a mail. Thank you in advance,
Riho Puusemp, newcomer as for LabVIEW
Mechanical Engineering student
E-mail: riho.puusemp@norma.ee ;; rihopuusemp@yahoo.com ;; riho.puusemp@autoliv.com
0 Kudos
Message 1 of 3
(2,957 Views)
In order to stop the main part of the program from 'freezing' when the data acqusition code is running is to put another while loop on the same diagram as your current while loop but outside of this current one (side by side). This will tell labview that you have two processes that you want to run at the same time. Put your data acqusition code in this new while loop. It is very important to put a small wait time in each loop. This can be found under 'Time/dialog' pallette of the functions pallette. In order to have it start and stop on command, surround this DA and build array code with a case structure. Your new while loop will also contain your array indicator (not outside anymore). Wire the case selector to your start button. While the button is depressed, the cod
e will acquire and add to the array. When the button is released, the code will stop acquiring data but all your current data will still be present. This should work for you. it is a bit sloppy (the way you are always adding on to the end of an array) but will work for you as a beginner. I would look into Ch 28 of the G programming manual to see how to efficiently handle arrays. Any more problems, just write.

Jared.
0 Kudos
Message 2 of 3
(2,957 Views)
As an interloper from 'The Other Side', I'd just like to say that this
simple task looks frighteningly difficult.

What you need is LabWindows ;-))


"Jared" wrote in message
news:5065000000050000006C1B0000-983677784000@quiq.com...
> In order to stop the main part of the program from 'freezing' when the
> data acqusition code is running is to put another while loop on the
> same diagram as your current while loop but outside of this current
> one (side by side). This will tell labview that you have two
> processes that you want to run at the same time. Put your data
> acqusition code in this new while loop. It is very important to put a
> small wait time in each loop. This can be found under 'Time/dialog'
> pallette of the functions pallette. In o
rder to have it start and stop
> on command, surround this DA and build array code with a case
> structure. Your new while loop will also contain your array indicator
> (not outside anymore). Wire the case selector to your start button.
> While the button is depressed, the code will acquire and add to the
> array. When the button is released, the code will stop acquiring data
> but all your current data will still be present. This should work for
> you. it is a bit sloppy (the way you are always adding on to the end
> of an array) but will work for you as a beginner. I would look into
> Ch 28 of the G programming manual to see how to efficiently handle
> arrays. Any more problems, just write.
>
> Jared.
0 Kudos
Message 3 of 3
(2,957 Views)