21.2.1 Procedure - Conditional Operations

  1. From the [Common Settings (R)] menu, select [Global D-Script (L)].

  2. Click [Create]. To view an existing script, select the ID number and click [Edit], or double-click the ID number row.

  3. The [D-Script] dialog box is displayed. 

  4. In [Trigger], select [Timer] and specify the [Timer Settings] as 1 second.

  5. Click the [Tool Box] tab. The toolbox allows you to easily place a command to use in the script.

  6. Create the first line of script. If you specify the D00100 default value as 0, the first line operation is a count operation that increases and stores the count every time a process completes.
    Click and select [Word Address], then click .

  7. Input D00100, and click [ENT]. Click [OK] in the [Address Input] dialog box.

  8. Click [Assignment (=)] in the Toolbox.

  9. Repeat steps 6 to 7 and place D00100.

  10. Click [Addition (+)] and type "1". The first row is now complete.

  11. Create the second row of the script. In the second row, when a condition becomes true, the process following the "if ( )" statement is executed.
    Click [if - endif].

  12. Create the conditional expression inside the brackets "( )" following "if". The conditional expression compares the value stored in D00100 to "3", and turns true if they are equal.
    Put the cursor inside the brackets (), repeat steps 6 to 7, and place D00100.

  13. Click [Equivalent (==)] and input "3". The second row is now complete.

  14. Place the cursor inside the "{ }" brackets and press Enter. Repeat steps 6 to 7 and place LS0008.

  15. Click [Assignment (=)] and input "7".

  16. The script is now complete.