Mitsubishi MELFA CR1D Instruction Manual page 247

Table of Contents

Advertisement

Open (Open)
[Function]
Open the file or communication lines.
[Format]
Open[] "<File Descriptor>" [][For <Mode>][]AS[] [#] <File No.>
[Terminology]
<File Descriptor>
File type
File
Communi-
cation line
<Mode>
<File No.>
[Reference Program]
(1) Communication line.
1 Open "COM1:" AS #1
2 Mov P_01
3 Print #1,P_Curr
40Input #1,M1,M2,M3
5 P_01.X=M1
6 P_01.Y=M2
7 P_01.C=Rad(M3)
8 Close
9 End
(2) File operation. (Create the file "temp.txt" to the controller and write "abc")
1 Open "temp.txt" FOR APPEND AS #1
2 Print #1, "abc"
3 Close #1
[Explanation]
(1) Opens the file specified in <File name> using the file number.
Use this file No. when reading from or writing to the file.
(2) A communication line is handled as a file.
[Related instructions]
Close
(Close),
Print
[Related parameter]
COMDEV
Describe a file name (including communication lines).
*To use a communication line, set "<Communication Line File Name>:"
*When not using a communications line, set "<File Name>"
File name
Describe with 16 characters or less.
COM1: Standard RS-232C(default value)
COM2:The setting in the "COMDEV" parameter.
:
COM8:The setting in the "COMDEV" parameter.
Designate the method to access a file.
*Omitted = random mode. This can be omitted when using a communication line.
*ÅEInput = input mode. Inputs from an existing file.
*OUTPUT = output mode (new file). Creates a new file and outputs it there.
*APPEND = Output mode (existing file). Appends output to the end of an existing file.
Specify a constant from 1 to 8.
To interrupt from communication line: 1 to 3.
' Open standard RS-232C line as file No. 1.20 Mov P_01
' Output current position to external source.
"(100.00,200.00,300.00,400.00)(7.0)" format
' Receive from external source with "101.00,202.00,303.00" AscII for-
mat.
' Copy to global data.
' Close all opened files.
(Print),
Input (Input)
Access method
Input,OUTPUT,APPEND
Omitted = random mode only
Detailed explanation of command words 4-234
4MELFA-BASIC IV

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melfa cr2dMelfa cr3d

Table of Contents