LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to update indicators in state machine ?

What is the best method to update indicators constantly in a SM ? ... 

 

MY INDICATORS: I want to update the cluster of OUTPUT INDICATORS for ever new update that is happening inside the FOR LOOP (see next image). How could I achieve that ?

 

Abhilash S Nair

Research Assistant @ Photonic Devices and Systems lab

[ LabView professional Development System - Version 11.0 - 32-bit ]

LabView Gear:
1. NI PXI-7951R & NI 5761
2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021

OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
MEMORY - [ 16.0 GB RAM ]
GPU - [ NVIDIA GeForce GT 530 ]
0 Kudos
Message 1 of 3
(2,608 Views)

Then you need to place the indicator inside the FOR-loop and undate it there. 🙂

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 3
(2,586 Views)

Since on my machine, the second screenshot is cropped, i cannot see the complete FOR loop. You do refer to the loop writing to VISA, correct?

 

If so:

- Is this loop timed? If so, what is the average iteration time? Note: if this is faster than about 50ms, you should not update the indicator in every iteration as the human simply cannot see changes that fast. An average user would only see some flickering and from time to time something "readable".

- Do you update the indicators elsewhere as well?

 

Possible solution:

- As Yamaeda suggests: Put the indicator in the FOR loop. Works well if only this loop updates these indicators.

- Local variable: As dataflow serializes access to the indicator (variable in loop, terminal outside the state case), you wont have race conditions. On the other hand bears risks if someone introduces concurrent loops using the same indicators (variables).

- Property node "value": Same as local variable, but is bound to UI thread. Therefore, it takes more time which induces performance drawbacks. On the other hand, a property node has error in/out and is better suited to be placed in well designed dataflow programming.

- Extract UI updates from the state machine and introduce a parallel running "UI Update" loop. Refer to the Producer/Consumer template for an initial start point.

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 3
(2,549 Views)