LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I add timer function?

Hi. I have a question.

I made a labview program which can do PID contoll.

But I don`t know how can add timer function.

 

1.When temperature is higher than set point, Timer have to be started.

 

2.After time which I set in timer, PID have to be off

 

3.But temperature is measuring and all temperature which is measured at all process should be plotted in one graph at real time.

 

How can I add this function in my labview?

 

 

0 Kudos
Message 1 of 7
(3,209 Views)

Solved

0 Kudos
Message 2 of 7
(3,179 Views)

Hi sky,

 

don't you think it would help other people when you would share the solution instead of writing just "solved"?

😉

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 7
(3,169 Views)

I`m sorry. But I`m not solve it by not a labview but other instrument.

So, I think that It can`t be help other. As a result, I wrote like that.

If you mind, I`m so sorry.

 

0 Kudos
Message 4 of 7
(3,166 Views)

Hi sky,

 

you also could solve the problem in LabVIEW, maybe utilizing ElapsedTime function.

 

Please keep in mind the suggestions you already got in your other thread on sequence frames, misuse of BytesAtPort function, repeated opening and closing serial ports…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 7
(3,163 Views)

Ok. Thank you for ur advice.

0 Kudos
Message 6 of 7
(3,156 Views)

I just looked at your LabVIEW and have to say there is no wonder you had to use an external hardware soultion, your code has so many things wrong with it you should scrap the whole thing and start over.

 

Here's a couple points.

  1. Don't open and close the VISA session every time you need to read or write to the serial port.
  2. Open all VISA sessions ONCE at the beginning of your program and pass the VISA reference throughout your program
  3. Close all VISA sessions ONCE at the end of your program, make that the last thing you do before exit.
  4. Lose the Flat Sequence Structures, use a proper program architecture like a State Machine. 
  5. Using a State Machine makes it trivial to add functions like timers, waits, and loop to different states depending on readings.
========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 7 of 7
(3,121 Views)