LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Variable in Case Structure range . . . or Similar

Solved!
Go to solution

Hello all,

I'm using Case Structure to control an output.

Basically the Case is getting temperature feedback from DAQ, when the temperature reaches, let's say, 100C. It sends a command to turn OFF the heat for one minute or until it reaches 70C. After a minute or until it reaches 70C, it sends the signal to turn the heat back ON.

It's working perfectly while it's all hard coded.

However, I want to make create a control for both UpperTemp = 100C & LowerTemp = 70C so the user can change the upper & lower boundaries in Front Panel without the need to go and change it in Block Diagram.

 

Is there a way to code this as a variable in Case Structure . . . or any other method to do this?

Sorry if this is a basic question, i'm new to LabView.

0 Kudos
Message 1 of 2
(2,365 Views)
Solution
Accepted by topic author Spartacus_1

Hi Spartacus,

 

so basically you want to create a control with a setpoint and a hysteresis. Maybe looking for words like these will result in useful threads…

 

No need for a case structure: you can use simple comparison functions (>=, <=) instead.

 

Creating an algorithm in some pseudocode may help too:

 

 

IF pv >= UpperLimit THEN state:=0 ELSE state:=state
IF pv <= LowerLimit THEN state:=1 ELSE state:=state

 

 

(pv is "process value", state is your desired output.)

Seems quite simple to create in LabVIEW!

Keep "state" in a shift register and create controls for UpperLimit/LowerLimit…

Best regards,
GerdW


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