Summary
The data of the string stored in the LS area is copied to the data buffer according to the number of strings in a byte-by-byte transfer. Store the Parameter 3 (Number of words) of data from Parameter 2 (Copy source address) in Parameter 1 (Copy to buffer) as a text.
Format
_ldcopy (Copy to buffer, Copy source address, Number of words)
Parameter 1: Data Buffer
Parameter 2: Internal Device
Parameter 3: Integer value, Internal Device, Temporary address (The valid range for Parameter 3 is from 1 to 1024.)
Example expression 1:
_ldcopy (databuf0, [w:[#INTERNAL]LS0100], 4)
The data in LS0100 to LS0103 is written into the 4 bytes of the data buffer, sequentially starting from "databuf0". Internal devices read in byte units (from the bottom bits).
The low 1 byte of the LS area is read out and the specified quantity of data is written into the data buffer.
The maximum value that can be assigned for Parameter 3 is 1,024. When a value exceeding the limit is set, Error Number 1 (string overflow) of the String error status [e: STR_ERR_STAT] is triggered.
Even when there is data in the upper byte of the internal device, only data from the bottom byte is read.
The processing is terminated when an error occurs and returns to the beginning of the Main function. (If the command comes while a function is running, it returns to the line that called that function.)
_ldcopy (databuf0, [w:[#INTERNAL]LS0100], 4)
When data is stored as illustrated above, data from the bottom byte is read and written to the data buffer.