Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing the value setpoint at every 50s using elapsed time express

Hi. I am developing a tank level control system program using Neural Network based controller and trying to compare with PID based controller. I need to do experiment to compare results of these two controllers. In order to do that, I need to developed a scenario of changing the value of setpoint at every 50s. For example:

 

when t >= 50s    , Setpoint = 5

           t >= 100s  , Setpoint = 4

           t >= 150s  , Setpoint = 6

           t >= 200s  , Setpoint = 0

 

Can I use the Elapsed Time Express to execute this and how? I know that PID have the Setpoint Profile that can execute this, but for the Neural Network Controller can this be done using the Elapsed Time Express?

 

Thank you.

0 Kudos
Message 1 of 4
(5,663 Views)

For the timing, you could us a state machine set up. In LabVIEW, a state machine is case structure within a while loop, where case structure represents states. Enums are typically used to move between states. You could have four states for the for timing states. When the Time Elapsed is True, you can move to the next state that wires a True to the Elapsed Time reset and pass a new Set Time. Then when elapsed time is true again, reset and put the next state. Use shift registers to pass data between loops.

 

 

State Machine Timer Setting.png

 

 

Taylor B.
National Instruments
0 Kudos
Message 2 of 4
(5,639 Views)

Hi there. I have solve the problem. Thank you for your help! This is how I solved it. I simply just add formula node inside the while loop and it works!

 

SP.jpg 

0 Kudos
Message 3 of 4
(5,624 Views)

Glad you got it working!

Taylor B.
National Instruments
0 Kudos
Message 4 of 4
(5,618 Views)