01-09-2017 03:10 PM
Flat sequence is best way to turn on boolean led during measurement? Is there any better solution for this?
01-09-2017 04:19 PM
Use a shift register to store a boolean that indicates if the measurement on or off. Read the shift register once in the while loop and connect it to an indicator. Change the value of the boolean shift register as you wish.
Generally, you do not need any sequence structures or local variables and I would advise not to use them. It is clumsy and although it may not be an issue here, your programming style makes your code prone to race conditions. Think dataflow!
Also, do not put wait functions inside the Event structure. All code in Event structures should execute immediately so the UI is responsive to user interactions.
01-11-2017 03:00 AM
Ok. I make 3 version. I think best version is without shift register. Is this good solution for indicates when measurement is on or off?
01-11-2017 07:48 AM
Anyone can confirm? Ver2 without shift register is ok?
01-12-2017 06:54 AM
It is ok, if it fulfill its purpose.
But if you would like to improve your code, follow perhult's advices. Also you could use clusters and type definitions to make your code easier to read and modify.
A good code should be easy to read. This is important, if you plan to work more with LabVIEW and create more complex applications in future.