SET
(Statement)
Sets an I/O port to ON.
SET <I/O variable>[,<Output time>]
This statement sets the designated port in <I/O variable> to ON.
If <Output time> is designated a pulse is output. (The output time unit is ms.)
If <Output time> is designated the system does not proceed to the next instruction until this time elapses. The specified output time value is the minimum output time while the actual output time will change according to task priority.
-
If output time is designated, it may be extended due to factors such as the presence of another program during movement, pendant operation, or communication with external devices.
-
When output time is designated, it may possibly shift by 16.7ms since the standard clock for controller processing is ±16.7 ms.
-
Note the following two points when using the time designation SET.
-
If you RESET the same port with another task while the port is ON due to the time designation SET, the port is set to OFF from the time of RESET (this means the time designation SET is valid).
-
If you keep resetting the same port and SET with another task while the port is ON due to the time designation SET, the designated port is set to OFF after the designated time elapses (time designation SET is valid).
-
When output time is used, note that even during temporary stoppage the output time will elapse after an instantaneous stop during execution of the instruction and restart of the system.
-
Specifying any number other than the ones for user outputs, hand outputs, and internal I/O ports causes the ERROR21FB (Reserved output area writing error). Be careful especially when using a mathematical expression for specifying a port number.
-
Cannot be used for the I/O variable declared as a SINGLE type. When executed, error 777F (real number conversion failure) will occur.
TAKEARM
|
'Obtains robot control priority.
|
IOBLOK ON
|
'Concurrently executes an I/O instruction with the next
'motion instruction.
|
MOVE P, (902.7,0,415.3,180,50,180,1)
|
|
|
'Moves (PTP control) to the coordinates
'(902.7,0,415.3,180,50,180,1).
|
SET IO[240]
|
'Sets the port 240 BIT type to ON.
|
SET IO[241],40
|
'Sets the port 241 BIT type to ON for 40 ms.
|
SET IO[SOL1]
|
'Sets the port designated by I/O variable SOL1 to ON.
|
SET IO[104 TO 110]
|
'Sets the port 104 to 110 BIT type to ON.
|
IF IO[242] THEN
|
|
RESET IO[240]
|
'Sets the port 240 type to OFF.
|
RESET IO[SOL1]
|
'Sets the port designated by I/O variable SOL1 to OFF.
|
RESET IO[104 TO 110]
|
'Sets the port 104 to 110 BIT type to OFF.
|
ENDIF
|
|
IOBLOCK OFF
|
|
|
|
TAKEARM
|
'Obtains the robot control priority.
|
SET IO[I1 * 5]
|
'Set the port number obtained by I1 multiplied
'by 5 to ON.
|
SET IO[27-24]
|
'Set the port number obtained by subtracting 24
'from 27 (=3) to ON.
|