10-10-2012 02:11 PM
another approach using a single loop event driven state machine....
10-10-2012 06:04 PM
In my case, I cannot stop loop. I need to keep saving data and stop saving
after certain time, I need to save data again
I will look at the example using queue.
In my case, I need to send saving msg to 3 consumer loops when I click save button. So queue is still a good choice not notifier , right?
I knew notifier may be useful for one producer loop and multiple consumerloops, is it right?
10-10-2012 06:56 PM
Actually I use this structure to control my valve. (event case and consumer loop)
If I use this one save data, I may also need to use SR to save the queue element . Otherwise, it will keep wait for saving message again.
I attached my case.
The first loop is displaying data in chart from NI 9213.
I used queue structure to send data to 'write to measurement file (consumer loop)'. In second loop, false case is empty , becasue save is false, I donot want data recorded in a file
In certain condition, which is determined by other device , I need to change "save " to true state, then data is recorded in a file (True case.)
After certain time, I need to change "save " back to false state, when I need, I may need to change save to true again...
Meanwhile, I have 2 more consumer loops which collect data from com port. I need to let these consumer loops saving data at the same time and stop at the same time....
So in my case, which methods are best ?
Thank you so much
10-10-2012 09:02 PM
@MYLONG wrote:
When I click save ,consumer loop will start save immediately
But When I click stop saving , after one loop it will stop. because the SR value is still true, so saving data loop will run one more loop then stop
Is there other methods to improve this?
Think about the logic. If you put the Save case structure AFTER the one that checks for the timeout, instead of parallel to it, it will work as you want.
10-10-2012 11:19 PM
Thanks. It works
10-11-2012 10:33 PM
This is also one good solution. Thanks,
By the way, how can I set up FP size so that when I open VI, it only shows the small window which includs controls and indicators, not a big window?
I try to use mouse to shrink FP size, but when I open it again, It looks not the same
10-12-2012 12:03 AM
The VI should save its position and size when you save it, and reopen at the same size and position. If you need it a different size only when you run it, check out the Window Run-Time Position category of VI Properties.