4-287
Detailed explanation of Robot Status Variable
4MELFA-BASIC IV
M_Open
[Function]
RetReturns the status indicating whether or not a file is opened.
Returns the status of other end of the RS-232C cable.
[Format]
[Terminology]
<Numerical variable>
Specify the numerical variable to substitute.
<File number>
Specify the file number 1-8 by constant value of communication line opened by
Open command. The default value is 1. If 9 or more are specified, the error will
occur when executing.
[Reference Program]
1 Open "COM2:" AS #1
' Open the communication line COM2 as the file number 1.
2 If M_Open(1)<>1 Then GoTo 110
' Wait until the file number 1 opens.
[Explanation]
(1) This is a read only variable.
(2) The return value differ corresponding to the file type specified by Open command as follows.
*Refer to separate manual "Ethernet Interface INSTRUCTION MANUAL" when using the ethernet.
[Related instructions]
[Related parameter]
COMDEV
Example)<Numerical variable>=M_Open [<File number>]
Kind of files
Meaning
Value
File
Returns the status indicating whether or not a file is
opened.
Returns 1 until the Close instruction, the End instruc-
tion or End in a program is executed after executing
the Open instruction.
1: Already opened
-1: Undefined file number (not
opened)
Communication line
RS-232C
*Returns the status of other end of the RS-232C
cable.
Returns the status of the CTS signal input as is.
(This can be used only when the RTS signal of other
end is enabled using the Mitsubishi genuine cable
specification.)
1: Already connected (CTS signal is
ON)
0: Unconnected (CTS signal is OFF)
-1: Undefined file number (not
opened)