User`s manual

12-4 Motion Mate DSM314 for Series 90-30 PLCs User's Manual
January 2001 GFK-1742A
12
IF BWNOT P100 THEN
This construct is okay.
IF BWNOT P001 <> P002 THEN
This construct is ILLEGAL too many operations.
If statements may nest up to 8 levels deep. When counting the number of program statements, the
IF-THEN and END_IF statements count as two separate statements.
Table 12-1. Valid Operators
Statement Type Valid Operators
Relational <, >, <=, >=, <>, =Conditional
Bitwise Logical BWAND, BWOR, BWXOR, BWNOT
Arithmetic +, -, /, *, MOD
Bitwise Logical BWAND, BWOR, BWXOR, BWNOT
Assignment
Abs Function ABS ()
Whitespace
Blanks, end-of-lines, and tabs are considered whitespace. Whitespace is ignored, except when used
to separate adjacent syntactic elements, and may be used to improve program readability by the use
of indention and blank lines.
Comments
Comments may be used to add information to the program that is ignored by the Local Logic
program execution engine. Two types of comments are supported.
The
(*
character pair introduce a normal comment, which terminates with the
*)
character pair.
These comments may appear anywhere whitespace can, for example within or following a local
logic statement, alone on a line, or spanning several lines. These comments do not nest.
The
//
character pair introduces a single line comment. All text following the
//
to the end of the
line is ignored by the Local Logic execution engine.
Note
The user needs to be aware that one can enter a local logic program and inadvertently comment out
the code that one wants to execute. The common scenario that causes this to happen is as follows:
(* This example shows a way to cause Axis 1 Digital Output # 1 to *)
(* turn on when Axis 1 Actual Position is between 4000 and 4500, *)
(* but only while the program is in Block #4. This demonstrates *)
(* functionality that is often implemented using a high speed counter *)
(* (HSC) and PRESET's. This example will achieve a resolution of 2 ms. )
Digital_Output1_1 := 0; (* Digital Output Axis 1 is Off *)
IF Block_1 = 4 THEN (* If current Block number for axis 1 equals 1 *)