12-18-2019 08:51 AM
Something like this should get you started. It assumes that you know how to use state machine, Shift registers, Data flow, Type Defs, Producer and consumer loops, Arrays, Event Structures.
If you don't know how to use all of these things you need to learn or editing this code will be very hard. If you do learn all of this it will be very easy.
This code can get more simple than this. I was trying to keep it simple so that you may be able to follow it.
12-18-2019 08:52 AM
I am just looking to log the sample for the 5 second read, and no need for averaging.
12-18-2019 10:31 PM
Hi Tim,
Thanks a lot for your help.
Would you please attach your original vi here, so I can learn from your vi as an example?
Your vi is more complex than I expected. I am not familiar with state machine and consumer loops. Thank you very much!
12-18-2019 10:43 PM
That is a VI snippet. Save the picture to your hard drive. Then drag the image file onto your block diagram. Then you should have code in a new VI.
12-19-2019 08:31 AM
Thank you for your help. Following your suggestion, I have tried but not succeed. Is this snippet only compatible with LabView2017? I am using a LabView 2012. Is there any method to obtain the corresponding Vi? Could you please attach an orignal Vi here? Thank you again for your help.
12-19-2019 09:17 PM
Yes. LV12 is too old to open an LV17 snippet.
I saved the snippet, brought it into a VI, then back saved the VI to LV12.
It will be broken because it has a typedef for the statemachine enum. But you can disconnect from typedef. Then save that enum as a new typedef control. And change all the other instances to your newly saved control.
12-20-2019 05:44 AM
Thank you so much for your help. This Vi is very helpful.