User`s manual
11-2 Motion Mate™ DSM314 for Series 90™-30 PLCs User's Manual
–
January 2001 GFK-1742A
11
Comments
Comments allow the programmer to describe program operation, or any information that the
programmer wishes to embed in the program. Comment text begins with the
(*
character pair and
terminates with the
*)
character pair and may appear anywhere within the program. For example:
(* Valid Comment Structure *)
The DSM during program execution ignores comments. Thus, comment lines do not count when
determining local logic program length.
Variables
Local Logic provides the user access to motion controller data, control and status bits, and
parameters using a fixed set of variables. The language also supports decimal, hexadecimal, and
binary constants. Hexadecimal and binary value representations are unsigned constants in program
statements, but are ALWAYS interpreted as signed two’s complement in mathematical
expressions. To assign a value to a variable the user would enter the following
Torque_Limit_1 :=5000; (* Sets Torque Limit Axis 1 to 50% *)
or in hexadecimal form
Torque_Limit_1:=16#1388; (* Set Torque Limit Axis 1 to 50% *)
When variables are assigned a numeric value they are automatically limit checked to a signed 32-
bit value. For example the following values represent the largest positive and negative values that
are acceptable.
P001:=16#7FFFFFFF; (* P001=2147483647 *)
or in decimal form
P001:=2147483647; (* P001=16#7FFFFFFF *)
To assign the maximum negative value the user would enter
P002:=16#80000000; (* P002=-2147483648 *)
or in decimal form
P002:=-2147483648;(* P002=16#80000000 *)
If the user enters a number that exceeds the above numerical limits an error will be generated
indicating that the constant is out of range.
Local Logic variables have a read, write, or read/write “directional” attribute. (Additional
information concerning the variables and their type are contained in chapter 13.) As an example,
the variable Positive End of Travel for Axis 1 (Positive_EOT_1) is a read only variable. As such,
the following is a valid construct:
P001:=Positive_EOT_1; (* P001 = Positive End of Travel Axis 1 *)
However, the following is an invalid construct:
Positive_EOT_1:=1;