08-07-2011 06:51 PM
Hello everyone,
I have developed a basic data acquisition system, whereby the user can acquire different data from the card connected to different sensors using a simple case structure. Sampling is for finite mode, so for example is the user wants to acquire data for 10 seconds he can specify the time and it will be acuired.
What I want to do is to implement a progress indicator so that the front panel shows some activity while the data is being acquired and not leave the user to contemplate if it is doing what its supposed to do. Any suggestion how I can implement this? data acquisition is conducted inside a case structure. Thanks for any ideas.
cheers,
08-07-2011 07:12 PM
Many ways to do this. A few:
08-07-2011 07:44 PM
Thanks ErnieH,
I know its a simple thing, but the problem becomes when I enter the case structure upon a true event (acquire data). When the acquisition occurs inside the case structure, other loops cannot be executed simulatneously. The case structure is only exited whence all data acquisition has occured. Global variable approach sounds good, let me see how this goes.
08-07-2011 08:15 PM - edited 08-07-2011 08:16 PM
You can create a sub-vi to run within the case structure. It would get updated every iteration, effectively becoming a counter.
Read State
This is an FGV. Two controls and on indicator. The property node is controlled by the number of measurements to take and the slider max limit is adjusted accordingly.
08-07-2011 09:17 PM
If you want it to update information to the user, then you need to have it running outside of the main loop, if that loop is running until it stops. Otherwise, the front panel will not be update You can create a loop outside of your main loop just to update controls, dials, etc. Just make sure it does not use all of your processing time by adding a delay. Best thing to do is to create a 2 dummy loops, one with the delay the other without, to test it out until you get something that will work for you. Good luck. When in doubt mock something up. That is the beauty of this language.
08-08-2011 07:20 AM
@ErnieH wrote:
If you want it to update information to the user, then you need to have it running outside of the main loop, if that loop is running until it stops. Otherwise, the front panel will not be update
Not necessarily. It depends on his structure. If he is acquiring data within is main loop which may be running as his top-level VI, then posting the data as it's acquired is no problem at all. As I said, it depends on his structure, but since the OP has not posted his VI, it's difficult to predict the behavior of his code; however, since he wants a running progress indicator as a visual aid to the user, it makes sense that the fp will be updated from within the loop.
If you are referring to my VI example, I created that with the assumption that it would be used as a sub-VI within his main loop.