omron — Example

V+ Remote Library Documentation Output Parameters Parameter Description status Status of the operation: 0 = success, Example .PROGRAM ex1.rm.pc() AUTO REAL i, num.items, status AUTO $file, $to.file, $lines[3] AUTO $file.spec LOCAL REAL types[] LOCAL $items[] $file = "C:\log.txt" ; Write 3 lines in a file on the PC FOR i = 1 TO 3 CALL rm.pc.fapp($file, $TIME(), 1, status) IF (status TYPE "Failure to append line on file: ", status END END ; Append multiple lines in 1 call to the same file $lines[0] = "Line 1" $lines[1] = "Line 2" $lines[2] = "Line 3" $lines[3] = "Line 4" CALL rm.pc.fapps($file, 4, $lines[], 1, status) IF (status TYPE "Failure to append line on file:

", status END ; Append multiple lines in 1 call specifying the start index CALL rm.pc.fapps2($file, 0, 4, $lines[], 1, status) IF (status TYPE "Failure to append line on file: ", status END ; Copy the file from the PC to the controller $to.file = "DISK>D:\log.txt" CALL rm.pc.fcopy($file, $to.file, 3, status) IF (status TYPE "Unable to copy the file to the controller: ", status END ; List all files on the PC $file.spec = "C:\*.txt" CALL rm.pc.fdir($file.spec, 3, num.items, $items[], types[], status) IF (status TYPE "Unable to delete the file from the PC: ", status END ACE Reference Guide, 18317-000 Rev A Page 819