09-05-2024 09:37 AM
You are not understanding the wait function and shift registers. The output of the wait function is the same as a 32bit counter and only differences between two readings will give you a relative time in ms (same as tick count). You wire the output into the shift register and use it as wait on the next iteration, which will cause it to wait anywhere from zero to 2^32ms, e.g. almost forever.
I already linked to a simple example, so study that. It uses the high resolution timer. (Again, only relative differences are useful, but opposed to tick count, the units are seconds and the type is DBL). The wait should be independent and just determine the loop rate with a constant wired to the input..
A scalar shift register does not "move" anything to anywhere, it refers to one memory location that gets updated as needed. In LabVIEW, "the wire is the variable" (simplified).
Saving a file for previous will not change any default values. It is possible that you did not make the current values default before saving.
09-05-2024 04:20 PM
I think I am beginning to understand but I still dont have it quite right.
Please see my updated program with the timer added and i have removed the external hardware IO so that I can simulate and run the program.
The temperature check and FIS states seem to be ok.
I tried using a case structure like what you had in your example but the elapsed time just flickers. I tried it connected to a select function and it did start counting up but the state didn't change when the value matched the duration value. What am i doing wrong here?
Also, is the elapsed time the time since the vi begins running or when that state is made active? I would like the latter but think it may be the other way round. The states change too quickly for me to be able to tell.
I feel like I am slowly getting there!
09-06-2024 09:55 AM
In the false case, you need to wire the old relative across. Else you constantly update the time reference and the difference will never exceed the loop time.
09-06-2024 01:53 PM
Thanks.
My timer is now counting up and returns to zero when it meets the duration time but the state is not incrementing. Have I missed something?
09-06-2024 02:36 PM
Apologies, it is changing state. It was just going too quick for me to notice.
09-09-2024 12:47 PM
Thank you for all your help, my program is working great now. I couldn't have done it without your advice, It's really appreciated.