LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I have a program that reads data from a daq card, then diplays

it on a screen, stores it in a file. Furthermore, there is the facility for the user to view an old file: he clicks abutton and then the file-open dialogue box appears, however, when this happens, the aquasition stops until you the dialogue box is closed.There is also a bit of slow down, when you click on different tabs on the screen. I have read up on multi-threading, but the info does not help me answer the question. Could anyone please advise me on how to solve this, if nulti-threading will work, and a tiny demo on the basics of it would be greatly appreciated. Thanks
0 Kudos
Message 1 of 5
(2,893 Views)
it on a screen, stores it in a file. Furthermore, there is the facility for the user to view an old file: he clicks abutton and then the file-open dialogue box appears, however, when this happens, the aquasition stops until you the dialogue box is closed.I suspect that you are using your dialog box and data acquisition in the same loop. If you are performing data acquisition, then bring up the dialog box for a filename (in the same loop), you aren't reading from the buffer because your loop is stuck waiting for some user input. I try to always put my acquisition in a separate while loop by itself. Therefore, it doesn't stop while I'm waiting for some input from the user or some other source.

I've noticed that there is a slow-down when you use tab screens if there is significant display changes. I haven't found a way to make that much faster myself.

Mark
0 Kudos
Message 2 of 5
(2,893 Views)
it on a screen, stores it in a file. Furthermore, there is the facility for the user to view an old file: he clicks abutton and then the file-open dialogue box appears, however, when this happens, the aquasition stops until you the dialogue box is closed.It sounds as if it should work. I tried putting the part of openening the file outside the main loop, but when i try and click the open button, it does not open anything. Please give me a small demo, use the temperature simulation vi or so. Please.
Thanks
0 Kudos
Message 3 of 5
(2,893 Views)
it on a screen, stores it in a file. Furthermore, there is the facility for the user to view an old file: he clicks abutton and then the file-open dialogue box appears, however, when this happens, the aquasition stops until you the dialogue box is closed.Matrix said:

>It sounds as if it should work. I tried >putting the part of openening the file >outside the main loop, but when i try and >click the open button, it does not open >anything. Please give me a small demo, use >the temperature simulation vi or so. Please.
>Thanks

Here's one of the LabVIEW examples modified.
0 Kudos
Message 4 of 5
(2,893 Views)
it on a screen, stores it in a file. Furthermore, there is the facility for the user to view an old file: he clicks abutton and then the file-open dialogue box appears, however, when this happens, the aquasition stops until you the dialogue box is closed.Open a new VI.

Put two WHILE loops on the diagram, side by side (not nested).

In each WHILE loop, pop up on the [i] terminal and create an indicator for it.

In each WHILE loop, put a WAIT(mSec) function with a constant wire to it.

Set the constant in one loop to 200, set the other constant to 300.

Wire the CONTINUE IF TRUE terminal of both loops to a constant TRUE.

Run it and watch the two indicators - they're running at different rates.

That is the basic multi-threading idea. You want one loop to handle user-interface stuff (file dialog, QUIT button, etc.) You want another loop to handle DAQ. You can process the data in the same DAQ loop, or a third loop, depending on your needs.

If you put the loops in separate subVIs, you can arran
ge their priority, execution systems, etc.

Make sure your user-interface loop either A) uses an EVENT structure for detecting button clicks, etc. or B) you put a WAIT function in your user-interface polling loop.

There's NO point in polling front-panel buttons 10 million times a second (I've seen it happen).
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

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