<AccessMode>: Parameter 4: Usage mode for this device/file
Type: STRING
Values: "SHARED": Device/file is requested in the "shared" mode. Other
channels can also use the device, i.e. also open in this
mode.
"EXCL": Device/file is exclusively used in the channel; no other
channel can use the device.
<WriteMode>:
Parameter 5: Write mode for the WRITE commands to this file/device (optional)
Type: STRING
Values: "APP": Attaching
The file is always kept regarding its contents; write calls
are attached at the end.
"OVR": Overwrite
The contents of the file are deleted and re-generated
using the subsequent write calls.
Note:
Using this parameter, the write mode configured in the extdev.ini file cannot be
overwritten. In the case of a conflict, then the EXTOPEN call is acknowledged
with error.
WRITE: Pre-defined procedure to write output data
EXTCLOSE: Pre-defined procedure to close an external device/file that has been opened
<Result>: Parameter 1: Result variable
Type: INT
Values: 0 No error
16 Invalid external path has been programmed
21 Error when closing the external device
<ExtDev>: Parameter 2: Symbolic identifier for the external device/file description to be
closed, see EXTOPEN!
Note:
The identifier must be identical to the identifier specified in the EXTOPEN call!
Example
Program code
N10 DEF INT RESULT
N20 DEF BOOL EXTDEVICE
N30 DEF STRING[80] OUTPUT
N40 DEF INT PHASE
N50 EXTOPEN(RESULT,"LOCAL_DRIVE/my_file.txt","SYN","SHARED")
N60 IF RESULT > 0
N70 MSG("Error for EXTOPEN:" << RESULT)
N80 ELSE
N90 EXTDEVICE=TRUE
Work preparation
3.23 Additional functions
NC programming
1000 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0