01-07-2021 07:16 AM
Dear LabView community,
Issue
I am timing a control with an event structure. That is, when I click on the control, it switches itself off after a certain amount of time. When the structure was added and program ran, no indication of a faulty code were given. However, the MFC (mass flow controller), that the control used to be able to switch on and off, no longer responded - though the timed control in LabView worked fine. The problem dissapeared when the event structure was removed.
Can you recognize some fault in my event structure?
Timeout event:
Value change event:
Additional information and code
I am running a LabView 2011 32-bit on a Windows 7 computer.
The whole code is quite hairy and connected to several devices in the lab, but I attach it in case it is of interest.
Thank you so much in advance,
Rebekka F
01-07-2021 07:25 AM - edited 01-07-2021 07:33 AM
Hi Rebekka,
@RebekkaF wrote:
However, the MFC (mass flow controller), that the control used to be able to switch on and off, no longer responded - though the timed control in LabView worked fine. The problem dissapeared when the event structure was removed.
Can you recognize some fault in my event structure?
There is a fault in the event structure and a general fault…
General fault: You forgot to THINK DATAFLOW! Your event structure will block the loop it is located inside as long as that "timing" operation takes place.
Fault in the event structure code: NEVER place code running longer than a few milliseconds inside an event case. It can block other code or prohibit user interface actions (by default)! (Your ElapsedTime ExpressVI is set to 20s!!!)
Simple solution:
Place the event structure in its own loop. Set a reasonable TimeOut value (or don't use the TimeOut event at all). You may also implement a simple statemachine for that "MFC control" (in its own loop!)…
On your VI: