MemOff Statement
Turns Off the specified bit of the memory I/O.
Syntax
MemOff { bitNumber | memIOLabel }
Parameters
- bitNumber
- Specify the memory I/O bit as an integer.
- memIOLabel
- Specify the memory I/O label.
Description
MemOff turns Off the specified bit of memory I/O. The 256 memory I/O bits are typically excellent choices for use as status bits for uses such as On/Off, True/False, Done/Not Done, etc. The MemOn instruction turns the memory bit On, the MemOff instruction turns it Off, and the MemSw instruction is used to check the current state of the specified memory bit. The Wait instruction can also be used with the memory I/O bit to cause the system to wait until a specified memory I/O status is set.
Note
Memory outputs off
All memory I/O bits are turned off when the controller are restarted. They are not turned off by Emergency stop, safeguard open, program end, Reset command, or Epson RC+ restart.
See Also
In, MemIn, InBCD, Off, On, MemOn, OpBCD, Oport, Out, MemOut, Sw, MemSw, Wait
MemOff Statement Example
The example shown below shows 2 tasks each with the ability to initiate motion instructions. However, a locking mechanism is used between the 2 tasks to ensure that each task gains control of the robot motion instructions only after the other task is finished using them. This allows 2 tasks to each execute motion statements as required and in an orderly predictable fashion. MemSw is used in combination with the Wait instruction to wait until the memory I/O #1 is the proper value before it is safe to move again. MemOn and MemOff are used to turn on and turn off the memory I/O for proper synchronization.
Function main
Integer I
MemOff 1
Xqt 2, task2
For i = 1 to 100
Wait MemSw(1) = Off
Go P(i)
MemOn 1
Next I
Fend
Function task2
Integer I
For i = 101 to 200
Wait MemSw(1) = On
Go P(i)
MemOff 1
Next I
Fend
Other simple examples from the command window are as follows:
> MemOn 1 'Switch memory I/O bit #1 on
> Print MemSw(1)
1
> MemOff 1 'Switch memory I/O bit #1 off
> Print MemSw(1)
0