LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI control loses connection to device when adding timing event structure for control

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:

RebekkaF_0-1610023580268.png

Value change event:

RebekkaF_2-1610023845310.png

 

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

0 Kudos
Message 1 of 2
(781 Views)

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:

  • You know all those device control code, which is placed from left to right on after the other, is executed in parallel due to "THINK DATAFLOW!"? Does your device even support commands issued in parallel? It seems you are communicating with several devices, so this might work…
  • Using LEDs as controls is highly misleading (aka bad UX): they usually are used as indicators…
  • The block diagram is way too big, think about using better data structures (like clusters) and subVIs…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 2
(772 Views)