LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can you assemble a timed case structure?

Solved!
Go to solution

Hello,

 

I have just gotten started with Labview. I watched a few videos and tutorials for the basics, but for the project I am working on, I need something similar to a timed case structure. I want to store multiple functions in different cases that time out after being executed, or after a given amount of time. Is there any functions or structures like that? 

 

This is my first time posting a question so feel free to let me know if I am doing something incorrectly.

 

 

0 Kudos
Message 1 of 4
(2,783 Views)
Solution
Accepted by topic author Ramonk

Hi Ramonk,

 

I want to store multiple functions in different cases that time out after being executed

Taking your words literally: Put a loop in each case set to run for a certain amount of time (using ElapsedTime).

 

Better approach: build a state machine…

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(2,760 Views)
Solution
Accepted by topic author Ramonk

All you need is a simple state machine consisting of an outer loop, a case structure with the various code version, one for each case, and a state variable (e.g. enum) in a shift register. Just switch states as a function of elapsed time.

 

(Don't trap yourself inside inner loops)

Message 3 of 4
(2,757 Views)

wrote:

I want to store multiple functions in different cases that time out after being executed, or after a given amount of time.


A MS Wait in each case would give each case a "timeout" (more like a duration). That's what a "timed case structure" would do (and why it doesn't exist). The function wouldn't time out, the case would.

0 Kudos
Message 4 of 4
(2,703 Views)