Mitsubishi Electric CR800 Series Ethernet Function Instruction Manual page 32

Electric industrial robot
Hide thumbs Also See for CR800 Series:
Table of Contents

Advertisement

3 Description of functions
M_OPEN
[Function]
Indicates whether or not the file has been opened.
[Format]
<Numeric variable> = M_OPEN [(<file number>)]
[Terminology]
<Numeric variable>
<File number>
[Reference Program]
1 ' Client Program ----------------
2 M1=0
3 M_TIMER(1)=0
4 *LOPEN:OPEN "COM2:" AS #1
5 IF M_TIMER(1)>10000.0 THEN *LERROR
6 IF M_OPEN(1)<>1 THEN GOTO *LOPEN
7 DEF ACT 1,M_OPEN(1)=0 GOSUB *LHLT2
8 ACT 1=1
9 *LOOP:M1=M1+1
10 IF M1<10 THEN C1$="MELFA" ELSE C1$="END"
11 PRINT #1,C1$
12 INPUT #1,C2$
13 IF C1$="END" THEN *LHLT
14 GOTO *LOOP
15 *LHLT:CLOSE #1
16 HLT
17 END
18 *LERROR:ERROR 9100
19 CLOSE #1
20 HLT
21 END
22 ERROR 9101
23 *LHLT2:CLOSE #1
24 HLT
25 END
3-6
Specify a numeric variable to be assigned.
Specify a file number constant between 1 and 8 for the communication line that
was opened by the OPEN instruction. If omitted, 1 is set. If 9 or higher is
specified, an error occurs when executed.
'Resets the timer to 0.
'Opens the line.
'Jumps when 10 seconds elapses.
'Loops if no connection is made.
'Monitors the down state of the server using an interrupt.
'Starts monitoring.
'Sends END after sending the "MELFA" string nine times.
'Sends a character string.
'Receives a character string.
'Jumps to CLOSE after sending "END."
'Loops.
'Closes the line.
'Halts the program.
'Ends.
'Generates error 9100 if no connection can be made to the
server.
'Generates error 9101 if the server is down during
processing.

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cr751 seriesCr750 series

Table of Contents