LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Press Push Button if time Elapsed

Solved!
Go to solution

Hello,

I am pushing a push button when I want to start my process, and then when I have pushed it I want to start counting 2 sec and repress the button to stop.

Do I need to create another while loop and to have the motor control outside??

Alexis_Koul_1-1597577452890.png

 

0 Kudos
Message 1 of 15
(1,888 Views)
Solution
Accepted by Alexis_Koul

Hi Alex,

 

by now you should have learned about THINK DATAFLOW: you cannot connect two data sources by a wire…

 

Suggestion:

Best regards,
GerdW


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

Hello Gerd,

I applied your comments but still is not working. The issue is that the cable needs to go to the Register To Write because the motor starts with the value of 2 and stops with 8 as my second figure shows. So the output of the Elapsed time I think it needs to be connected somehow with that part

Alexis_Koul_0-1597639788317.png

Alexis_Koul_1-1597639874036.png

 

 

0 Kudos
Message 3 of 15
(1,811 Views)

Hi Alex,

 


@Alexis_Koul wrote:

I applied your comments but still is not working. The issue is that the cable needs to go to the Register To Write because the motor starts with the value of 2 and stops with 8 as my second figure shows. So the output of the Elapsed time I think it needs to be connected somehow with that part


Then you need to connect it to that Select node. (Switch "Motor control" to an indicator…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 15
(1,806 Views)

Hello GerW,

But if I switch the control to indicator that I cannot activate it when ever I want.

-Alex

0 Kudos
Message 5 of 15
(1,772 Views)

Hi Alex,

 


@Alexis_Koul wrote:

But if I switch the control to indicator that I cannot activate it when ever I want.


Then you need to implement some (boolean) logic to allow for parallel operation of either the ElapsedTime activation or using the control button.

 

Write down what you want to achieve! (In this desciption there should should be a sentence containing the words "AND" or "OR", when you describe the operation by button or ElapsedTime…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 15
(1,764 Views)

Hello GerdW,

I want when I push the button of motor to start, the Start time in the Elapsed time also to Start. Then I want after 2 seconds, the motor to stop.

I am not very familiar with the Boolean Logic..

Alexis_Koul_0-1597725872500.png

 

0 Kudos
Message 7 of 15
(1,733 Views)

Now you have a function where if time has elapsed AND Motor Control is pressed, then that output doesn't go anywhere.

 

Didn't you say you wanted that to go to the select statement for the Modbus write?

 

Why do you now have that 2/8 decision going to Set Start Time.

 

Please step back.  Write down the steps on paper as the logical order that stuff should be done.  Then wire it up that way.

Right now it seems like you are just throwing wires together on the block diagram because they happen to connect without any plan behind it.

0 Kudos
Message 8 of 15
(1,729 Views)

If I put the wire to the Modbus write is broken.

Also by having it like that, everything works, is just when the elapsed time pass, the motor still running.

I have the decision 2/8 going through so when I click the button, and the start time starts with it.

I know that the AND output should be connected somewhere, and that was the question.




0 Kudos
Message 9 of 15
(1,725 Views)

But in an earlier message, you shows a 2 or an 8 going to the Modbus Write in address 2000.  Does that make any sense?

 

What does the manual say should be written to address 2000 to start or stop the motor?  It is probably a 1 or 0 that is a U16 integer.  But you have to read the manual.

 

I just rediscovered your original thread. https://forums.ni.com/t5/LabVIEW/Control-of-AC-Motor-through-VFD-with-Modbus-communication-via/td-p/...

You said you got it working there.  So what did you do there?  Repeat it here.

0 Kudos
Message 10 of 15
(1,722 Views)