Check digital input value for a duration
gregf
✭
Hi All,
I am new in robot programming, so apologize if my question is maybe a basic one.
I have an external software which sends an digital input to my IRC5 controller. The value 1 or 0.
I want to check the value of the DI during a period of time. In fact I want to be sure that the DI stays at the value 1 during at least 30 seconds. and then pass to the next action.
Is there any simple solution?
Thanks for your help
0
Comments
-
This below will wait until the signal becomes logic HIGH (it will wait there infinitely until you reset program pointer or another method - add a maxtime and timeout signal to that if you want to) then checks it for your 30 seconds.
Jon
VAR bool bSignal_High_For_30s;!WaitDI diInputSignal, 1;!bSignal_High_For_30s:=FALSE;WaitDI diInputSignal, 0 \MaxTime:=30 \TimeFlag:=bSignal_High_For_30s;!IF bSignal_High_For_30s=TRUE THEN!! signal high for 30 seconds!ELSE!! signal went low before 30 seconds expired!ENDIF1
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 798 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings