From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Events and Case structure

New users who is very lost. Can some one explain the uses of a Case Structure and an Event Structure using very simple principles. Also when would you use each and the differences.

0 Kudos
Message 1 of 3
(2,478 Views)

A case structure is when you have something to choose among.

A value is True or False,

A value is an integer, case 0, 1, 2, 9999,  Default

A value is a string of certain value.

A value is an enum (a predefined list,  an "enumerated" list).

 

An event structure is similar in that one of many cases could execute, but is based on an "event" rather than a value.

It will wait for a control's value to change.

It will wait for a mouse action

It will wait for a key press,

It will wait for a user defined event (which in this case the "user" means the LabVIEW programmer)

It will wait for an amount of time to pass without another action, then execute the timeout case.

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
Learn LabVIEW

Message 2 of 3
(2,465 Views)
  • A case structure selects among alternative code (one diagram for each frame) and executes it as soon as all inputs have data. Learn about dataflow!
  • An event structure just sits there until a given event occurs (mostly something the user does on the UI: button press, control change, etc.), at which point the relevant case executes).

As a beginner, focus on the case structure first. Event structures requires more detailed knowledge.

Message 3 of 3
(2,430 Views)