Summary
Initializes all devices at once. Initialize the number of bytes (Parameter 3) starting from address (Parameter 1) with the defined data (Parameter 2).
Initialize Memory (String Mode) is available when tags are registered.
Format
memsetstr (Address, Data, Number of bytes)
Parameter1: Device address, Symbol variable
Parameter2: Numeric value (The valid range for Parameter 2 depends on the display type. Dec: 0 to 255, Hex: 0 to FF, Oct: 0 to 377)
Parameter3: Numeric value (The valid range for Parameter 3 is from 1 to 640.)
Example expression:
memsetstr ([w:[PLC1]TagName], 0, 5)
In the above example, 0 is written to 5 bytes starting from PLC1's TagName1.
When writing data to the LS Area with the Initialize Memory (String Mode) (memsetstr) 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).
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], 0xFF, 5)
(Parameter1 (16 bit length), Parameter2 (0xFF), Text Data Mode4)
Write: Write the specified number of bytes of data, and write 0 in remaining areas. Data remains unchanged for devices that are not initialized. ("0x55", "0x66" in the above example)