22.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. For the [Trigger] select [Timer], and specify the [Timer Settings] as 1 second.

  4. 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 icon , select [Word Address], then click .

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

  6. Click the [Tool Box] tab. Click [Assignment (=)] to enter the [Script Expression Area].

  7. Repeat steps 4 to 5 and place D00100.

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

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

  10. Following the if statement, create the conditional expression inside the brackets "( )". 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 4 to 5, and place D00100.

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

  12. Place the cursor inside the "{ }" brackets and press Enter. Repeat steps 4 to 5 and place LS0008.

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

  14. The script is now complete.