‎01-09-2010 05:04 AM
Hi
I have this VI , which will be trigger by voltage signal and then exit when it drop to a certain value.
The signal is initiated by me and it will rise follow by a fall and stop.
Once my VI capture the signal, the VI will automatically calculated the capture signal to give me the result of 4 features. Simply saying , this VI gives 4 features after measurement.
I will initiate the signal again and the process repeat.
In my VI, i want it to recognize that the 1st measurement is done when the signal exit a certain value.
The front panel will display the result of Measurement 1 as shown in the first row of boxes in the picture.
Measurment 2 and 3 will be pending for the next measurement to start.
1) My 1st question is that the results of the 4 features in Measurement 1, could it be saved in a temporary memory without having to save?
2) Could my VI be pending for the 2nd Measurement to start ?
3) I want my VI to be taking up to 3 measurement before it finally end.
I want the 3 set of features to be saved in a temporary memory. Only after the 3rd measurment is done, the VI would evaluate the whole 3 set of features and then all the values would be saved.
‎01-09-2010 05:40 AM
Temporary memory: well, keep the data on a wire, that's all you can do. And I hope you know what shift registers are, they carry the data in the wire over to the next loop iteration.
Although it is not necessary for the requirements you wrote down here, consider learning what a state machine is.Use the search function on ni.com...
Felix
‎01-12-2010 09:31 PM
Hi pengxin,
What you want to do can be quite easily achieved. You can loop your existing code 3 times, and make use of a case structure to check which run it is to decide which indicators to display the result on.
A state machine architecture, like Felix suggested, would be a good way to keep your codes scalable and maintainable in the long run.
Here's a few links for you to read up on state machines:
Application Design Patterns: State Machines
The indicators will hold the value of your results until the VI stops so they are temporary memory buffers in a way. After your code loops 3 times, you can wire the information from the indicators to your file saving portion of the code.
Regards,
Boon Chen
NI ASEAN
‎01-19-2010 09:47 AM
Hi Boon Chen
I would try this and get you updated . Thank you
Cheers
PX