Download Print this page

Omron NS Reference Manual page 43

Hide thumbs Also See for NS:

Advertisement

Section2 Functions
NS series Macro Reference
READCF
Reads the contents (values in binary) of the specified file in a memory card
(CF) to PT memory
Applicable versions
Format
Function
Return Value
Example
System version 4 or higher
READCF(Mem, Size, File, Dev)
Reads the contents (binary format) of the specified file in a Memory Card to PT
memory.
Mem: Top address of destination. ($W, $HW or $SW) Index can be set.
Setting range for $W is between 0 and 32767 and for $HW is between 0 to
8191. $B, $HB and $SB cannot be specified.
Size: Data size to be read. (unit: word)
Data size can be specified using long word directly, or $W or $HW(uses 2
words) indirectly. Setting range for $W is 0 to 32767 and for $HW is between
0 and 8191. If the set value is exceeded the maximum, an access error
occurs and an error message appears.
If the value 0 or less is set for Size, the specified size will be read to the PT
memory.
If the file size is bigger than the value set for Size (Size>0), it
executes reading data set for Size.
If the file size is smaller than the value set for Size(Size>0), it executes
reading actual file size only.
File: Source file name
The file name can be specified using character string directly, or $W or $HW
(uses 2 words) indirectly. Read action is executed by word unit, however, the
last 1 byte of address will not be read if file size is odd byte. (Return value
will be 0). Up to 43 alphanumerical characters ("0 to 9", "A to Z", " a to z", "$",
"_") including extension can be set for the file name.
Dev: Specify destination device. Always specify 0 since
destination will be a memory card only.
0: Completed normally
-1: Failed to read data
1. $W100=READCF($W1000,0", CF_FILE.BIN",0);
2. $W2000L=0;
STRCOPY($W2002, "CF_FILE.BIN");
$W100=READCF($W1000,$W2000,$W2002,0);
23

Advertisement

loading

This manual is also suitable for:

Ns-series