Summary
Copies device memory with one operation. Copy the number of bytes (Parameter 3) in the source address (Parameter 2) to the destination address (Parameter 1).
When there are NULL characters in the source address, these are also copied. NULL is not added at the end of the destination address.
You can use Copy Memory (String Mode) when tags are registered.
Format
memcpystr(Destination address, Source address, Number of bytes)
Parameter1: Device/PLC address, Symbol variable, or Internal Device
Parameter2: Device/PLC address, Symbol variable, or Internal Device
Parameter3: Numeric value (The valid range for Parameter 3 is from 1 to 640.)
Example expression:
memcpystr ([w:[PLC1]TagName1], [w:[PLC1]TagName2], 5)
In the above example, read 5 bytes from PLC1's TagName2 and then write the data to PLC1's TagName1.
When writing data to the LS Area with the Copy Memory (String Mode) (memcpystr) function, you can write data into the User area only. Data cannot be written into the System Data area (LS0000 to LS0019), Special area (LS2032 to S2047), or Reserved area (LS2048 to LS2095). However, you can read data from these areas.
You cannot set devices with Data Type = [DATE_AND_TIME].
When using 16 bit devices for Parameter1 and Parameter2, 1 device is treated as 2 characters. When using 32 bit devices, 1 device is treated as 4 characters. There is no dependence the D-Script bit length.
If you defined devices that cannot be evenly divided into bytes per device, it is processed as follows.
For example, memcpystr([w:[PLC1]W30.3000], [w:[PLC1]BD1000], 5)
(For Parameter1 (16 bit length), Parameter2 (32 bit length), and Text Data Mode4)
Read: Read the specified number of bytes of data. (read 0x11 to 0x55)
Write: Write the specified number of bytes of data, and write 0 in remaining areas. Data remains unchanged for devices that are not copied. ("0xAA", "0xBB" in the above example)