Make sure to leave an interval longer than the communication cycle time for executing write operations onto the connected device.
When write operations onto the connected device are executed frequently by using the scan counter of the display unit's internal special relay, communication errors or system errors may result.
When the bit used for the D-Script Triggered Condition is set for "touch" and that bit turns OFF during D-Script processing, the timing used when pressing the touch area repeatedly can prevent the detection of the bit's rise.
The D-Script trigger compares the previously read out value to the currently read out value to determine if the trigger is now "True". However, during a single scan, the value that is stored in the bit address used during the Triggered operation is kept the same, even if the value is changed during execution. The new value is read out only after the next scan begins.
For example, when Touch is used to turn ON the trigger bit (LS010000), and D-Script turns the value OFF:
Triggered Condition: Bit ON [#INTERNAL] LS010000
Expression: clear ([b:[#INTERNAL]LS010000])
D-Script Processing Timing Chart
For example, if the D-Script touch timing is not used, and only detection is performed, the processing is as follows.
Using an if ( ) statement to detect a trigger:
Use an if statement to determine if a touch operation sets the bit. Each time the if () statement runs, it reads the value and runs a comparison check.
Trigger Condition: BitON[#INTERNAL]LS203800 *1])
Script Expression Area :if([b:[#INTERNAL]LS010000]==1)
{
clear([b:[#INTERNAL]LS010000])
:
:
*1 Display unit internal counter. The counter increments each time the Part set on the display screen processes.
When using the previous D-script, even if you input consecutive touches, the script is run only if the condition matches. As shown in the following timing chart, every display scan the value is read and checked for a match, and if there is a match, regardless of the previous value, the script is run.
D-Script Processing Timing Chart