On Statement
Turns on the specified output and after a specified time can turn it back off.
Syntax
On { bitNumber |outputLabel } [ time ], [ parallel ] [,Forced]
Parameters
- bitNumber
- Specify the I/O output bits to be turned on as an integer.
- outputLabel
- Specify the output label.
- time
- Specify the time in seconds that the specified output bit is on. After the time interval expires, the Output is turned back off. (Minimum time interval is 0.01 seconds)
- parallel
- Optional. When a timer is set, the parallel parameter may be used to specify when the next command executes:
- 0 - immediately after the output is turned on
- 1 - after the specified time interval elapses. (default value)
- Forced
- Optional. Usually omitted.
Description
On turns On (sets to 1) the specified output.
If the time interval parameter is specified, the output bit specified by outnum is switched On, and then switched back Off after the time interval elapses.
The parallel parameter settings are applicable when the time interval is specified as follows:
- 1: Switches the output On, switches it back Off after specified interval elapses, then executes the next command. (This is also the default value for the parallel parameter. If this parameter is omitted, this is the same as setting the parameter to “1”.)
- 0: Switches the output On, and simultaneously executes the next command.
Notes
Output bits Configured as remote
If an output bit which was set up as remote is specified, an error will occur. Remote output bits are turned ON or OFF automatically according to system status. For more information regarding remote, refer to the following manual:
"Epson RC+ User’s Guide"The individual bits for the remote connector can be set as remote or I/O from [Setup]-[System Configuration]-[Controller]-[Remote Control] panel.
Outputs and When an Emergency Stop Occurs
The Controller has a feature which causes all outputs to go off when an E-Stop occurs. If you want to keep the settings even in case of the emergency stop, this feature can be reconfigured from the [Outputs Off during emergency stop] checkbox in [Setup]-[System Configuration]-[Controller]-[Preferences].
Forced Flag
This flag is used to turn On the I/O output at Emergency Stop and Safety Door Open from NoPause task, NoEmgAbort task (special task using NoPause or NoEmgAbort at Xqt), or background tasks.
Be sure that the I/O outputs change by Emergency Stop and Safety Door Open when designing the system.
See Also
In, InBCD, MemOff, MemOn, Off, OpBCD, Oport, Out, Wait
On Statement Example
The example shown below shows main task start a background task called “iotask”. The “iotask” is a simple task to turn discrete output bits 1 and 2 on and then off, Wait 10 seconds and then do it again.
Function main
Xqt iotask
Go P1
.
.
.
Fend
Function iotask
Do
On 1
On 2
Off 1
Off 2
Wait 10
Loop
Fend
Other simple examples from the Command window are as follows:
> on 1
> off 1, 10 'Turn Output 1 off, wait 10 seconds, turn on again
> on 2
> off 2