Mitsubishi Electric CR750-Q Instruction Manual page 370

Cr750/cr751/cr760 series
Hide thumbs Also See for CR750-Q:
Table of Contents

Advertisement

4MELFA-BASIC V
M_Open
[Function]
Returns the status indicating whether or not a file or communication line is opened.
[Format]
Example)<Numerical variable>=M_Open [<File number>]
[Terminology]
<Numerical variable>
<File number>
[Reference Program]
1 Open "COM2:" AS #1
2 *LBL:If M_Open(1)<>1 Then GoTo *LBL
<Using the ethernet I/F>
1 ' Client Program ----------------
2 M1=0
3 M_Timer(1)=0
4 *O1
5 Open "COM2:" As #1
6 If M_Timer(1)>10000.0 Then *E1
7 If M_Open(1)<>1 Then Goto *O1
8 Def Act 1,M_Open(1)=0 GoSub *E2 'Monitors the down state of the server using an interrupt.
9 Act 1=1
10 *M1
11 M1=M1+1
12 If M1<10 Then C1$="MELFA" Else C1$="END" 'Sends END after sending the "MELFA" string nine
13 Print #1,C1$
14 Input #1,C2$
15 If C1$="END" Then *C1
16 GoTo *M1
17 *C1
18 Close #1
19 Hlt
20 End
21 *E1
22 Error 9100
23 Close #1
24 Hlt
25 End
26 *E2
27 Error 9101
28 Close #1
29 Hlt
30 End
4-350 Detailed explanation of Robot Status Variable
Specify the numerical variable to substitute.
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.
'Resets the timer to 0.
'Opens the line.
'Jumps when 10 seconds elapses.
'Loops if no connection is made.
'Starts monitoring.
'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.
' Open the communication line COM2 as the file number 1.
' Wait until the file number 1 opens.
times.

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cr750Cr751-qCr751-dCr760-dCr760-qCr750-d

Table of Contents