LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

外部出力(モーター)の秒数制御 Control of the number of seconds of external output (motor)

digital input,digital outputを使用してモーターを3秒動かす、5秒停止、再び3秒動かして完全停止の順に制御したいのですが上手く出来ません。どのようにすれば成功するのか、御教授願います。(ピン番号は自由)

I want to control in the order of digital input, digital output to move the motor for 3 seconds, stop for 5 seconds, move again for 3 seconds and then stop completely, but it can not be successful. Please teach how you can succeed.(Pin number is free)

0 Kudos
Message 1 of 4
(2,838 Views)

Hi eqz,

 

the simplest solution would be a hardcoded sequence of code!

A better solution would implement a state machine...

 

What have you tried? Where are you stuck?

Best regards,
GerdW


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

_20180729_095424.JPG

 

Though it was possible to move it for 3 seconds by stopping for 3 seconds and stopping it for 5 seconds, it is impossible to finish the standby state (permanent stop as long as there is no external input) at the end. How do I do it?

0 Kudos
Message 3 of 4
(2,796 Views)

You're confusing Delay and Elapsed Time?

 

The first is what you want.  It'll hold the application for a period of time.

 

The second will check to see if the time has elapsed and then move on.  It takes practically no time and won't hold your application.  It's meant to be used to check if a duration has passed so you don't hold up your application.  Ideally, you'd loop back to check rather than trying to run a single loop and make your UI appear to hang while waiting.

 

You'll also want to see if you have watchdogs in your hardware.  Those may require a more frequent send of the motor value.  If you don't do that, it may stop moving because you're not feeding the watchdog. 

0 Kudos
Message 4 of 4
(2,787 Views)