From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

timing control for motor

Hi,

 

I am developing a VI that needs an output motor to be switched "ON" for some fixed timing. Like If an event is sensed using a sensor, the motor should run for exactly 2 minutes and then stop. Please help how to achieve it and what logic or function should be used to achieve this.

 

Thanks to all of you in advance.

 

Atul Goyal.

0 Kudos
Message 1 of 3
(2,705 Views)

Hi Atul,

 

the motor should run for exactly 2 minutes and then stop

Please define "exactly"! Is it in the order of seconds or is it nanoseconds?

 

My advice is to use a state machine to switch this motor ON and OFF. And use ElapsedTime to start and stop your timer…

Best regards,
GerdW


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

Hi Atul,

Frist write a simulation code with State machine architecture. You can find the template for State machine here. Use Elapse time or Wait Until Next ms Multiple for timing control( In this method you can get 1ms accuracy). If every thing working fine in this simulation, change your code to interface hardware.Smiley Happy

 

 Happy to Wire

Happy to Wire
0 Kudos
Message 3 of 3
(2,658 Views)