145
Doc.Id. HMSI-27-212
Anybus CompactCom 40 EtherNet/IP
Doc.Rev. 1.5
Read a File
The following example opens weld_info.txt in the reports folder an read data from the file.
Start
InstX = Obj.Create( )
InstX.File Open( R, \reports\
weld_info.txt )
data = InstX.File Read( Size )
EOF
(Zero bytes returned)
End
InstX.File Close( )
Obj.Delete ( InstX )
Yes
No
Create a new instance. The instance number
returned will be used by subsequent commands.
Open file for reading (CmdExt[0] = 0) and point
to the file to open. The instance can now be used
for file operations. Any directory operations will
be rejected.
Read Size number of bytes from the file.
Keep reading until the Read command returns
zero (0) or the desired content has been read.
Close the file.
Delete the instance.