LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timer

How to create a timer that starts after a boolean changes to TRUE and after the time we set elapses (for example 7 seconds) we go to the next state in the state machine

0 Kudos
Message 1 of 16
(1,171 Views)

Can we assume that you studied what was suggested to you two weeks ago? Did you run into any specific problems?

Message 2 of 16
(1,168 Views)

It helped me a lot but I didn't quite understand it fully because I'm a beginner. I have to use NI DAQ hardware and after a signal crosses a threshold voltage the timer starts. So I used DAQmx read and a threshold constant in a "Greater than" function, that should give me a boolean and now i don't know how to start a timer when boolean turns TRUE

0 Kudos
Message 3 of 16
(1,155 Views)

Most people here don't have your exact hardware, so start with a simple simulation, replacing the analog input with a front panel slider where you can change the voltage. Just keep reading it and when the threshold is reached, go to the state that counts down the timer. Feel free to attach what you made and we will offer some guidance.

Message 4 of 16
(1,147 Views)

grillmillivanilli_0-1651971324041.png

I used your timer but I need it to start only when the current value is greater than my threshold, so I need your help to show me where to connect my ''greater than'' function. I honestly don't even know if this will work i just need to pass an exam

0 Kudos
Message 5 of 16
(1,137 Views)
@grillmillivanilli wrote:

 

I used your timer but I need it to start only when the current value is greater than my threshold, so I need your help to show me where to connect my ''greater than'' function. I honestly don't even know if this will work i just need to pass an exam


I admire your honesty!  Have you considered simply bribing the Instructor?  Do you want our help in lying to the Instructor (who expects you to do your own work)?

 

What is it that you do not understand?  You apparently know about the "Greater-than" function, which you can you say (True or False) that the Current Value is greater than the Threshold.  Can you think of a LabVIEW Structure (that's a hint) that distinguishes between True and False, doing one set of code if True and another set of code if False (or maybe doing nothing if False)?  Does that give you any clues?

 

You didn't attach your existing code (meaning the entire VI), so I can see, in context, what you are trying to do, and can maybe make more directed suggestions to help you to learn LabVIEW, which should be your goal, not simply "passing the Test".  You might already have the requisite Structures in your code, in which case I'd be happy to point them out to you.  I'll surely be viewing the LabVIEW Forums tomorrow, and if you've posted your VI, I'm certain you'll get more help ...

 

Bob Schor

Message 6 of 16
(1,122 Views)

It's hard to tell much from a truncated picture, but don't use any inner loops that prevent the outer loop from spinning. Only the outermost loop is needed. You also still have glaring misconceptions about the magic of dataflow. If you wire to the stop condition of the FOR loop from the outside, that loop will either stop immediately, or continue forever. Do you know why?

Message 7 of 16
(1,112 Views)

Here you are, note that it's not finished and that it's probably not correct 😄

0 Kudos
Message 8 of 16
(1,109 Views)

You need to "save fore previous" I cannot open Vis saved in LabVIEW 2021 yet.

Message 9 of 16
(1,097 Views)

grillmillivanilli_0-1652012464462.png

for which version should i save it?

0 Kudos
Message 10 of 16
(1,035 Views)