4-111
MELFA-BASIC V functions
4MELFA-BASIC V
4.1.4 Inputting and outputting external signals
This section explains the general methods for signal control when controlling the robot via an external
device (e.g., PLC).
(1) Input signals
Signals can be retrieved from an external device, such as a programmable logic controller.
The input signal is confirmed with a robot status variable (M_In(), etc.) Refer to
for details on the robot status variables.
*Command word
*System variables
M_In, M_Inb, M_Inw, M_DIn
*Statement example
*Related functions
(2) Output signals
Signals can be output to an external device, such as a programmable logic controller.
The signal is output with the robot status variable (M_Out(), etc.). Refer to
Page 140, "4.3.26 Robot status
for details on the robot status variables.
*Command word
*System variables
M_Out, M_Outb, M_Outw, M_DOut
*Statement example
*Related functions
Command word
Explanation
Wait
Waits for the input signal to reach the designated state.
Statement example
Explanation
Wait M_In(1)=1 .................................................................
Waits for the input signal bit 1 to turn ON.
M1=M_Inb(20) ..................................................................
Substitutes the input signal bit 20 to 27, as an 8-bit state, in numeric variable M1.
M1=M_Inw(5)....................................................................
Substitutes the input signal bit 5 to 20, as an 16-bit state, in numeric variable M1.
Function
Explanation page
Signal output ................................................................................
Page 111, "(2) Output signals"
Branching with input signal ..........................................................
Page 104, "(1) Unconditional branching, conditional branching, waiting"
Interrupting with input signal ........................................................
Command word
Explanation
Clr
Clears the general-purpose output signal according to the output signal reset pattern in the
parameter.
Statement example
Explanation
Clr 1 ...........................................................................
Clears based on the output reset pattern.
M_Out(1)=1 ...............................................................
Turns the output signal bit 1 ON.
M_Outb (8)=0 ............................................................
Turns the 8 bits, from output signal bit 8 to 15, OFF.
M_Outw (20)=0..........................................................
Turns the 16 bits, from output signal bit 20 to 35, OFF.
M_Out(1)=1 Dly 0.5 ...................................................
Turns the output signal bit 1 ON for 0.5 seconds. (Pulse output)
M_Outb (10)=&H0F ...................................................
Turns the 4 bits, from output signal bit 10 to 13 ON, and turns the four bits from 14 to 17 OFF.
Function
Explanation page
Signal input ........................................................................................
Timer ..................................................................................................