CDS-3310
Chapter
7 Application Programming
i
37
* Note that these functions are multi-valued. An application program may be used to find the correct
band.
Functions may be combined with mathematical expressions. The order of execution of mathematical
expressions is from left to right and can be over-ridden by using parentheses.
Instruction Interpretation
v1=@ABS[v7]
The variable, V1, is equal to the absolute value of variable V7.
v2=5*@SIN[pos]
The variable, V2, is equal to five times the sine of the variable,
POS.
v3=@IN[1]
The variable, V3, is equal to the digital value of input 1.
Variables
For applications that require a parameter that is variable, the CDS-3310 provides 510 variables. These
variables can be numbers or strings. A program can be written in which certain parameters, such as
position or speed, are defined as variables. The variables can later be assigned by the operator or
determined by program calculations. For example, a cut-to-length application may require that a cut
length be variable.
Instruction Interpretation
PR posa
Assigns variable ‘posa’ to PR command
JG rpmb*70
Assigns variable ‘rpmb’ multiplied by 70 to JG command.
Programmable Variables
Each variable is defined by a name which can be up to eight characters. The name must start with an
alphabetic character, however,
numbers are permitted in the rest of the name. Spaces are not permitted. Variables can be upper or
lowercase, or any combination. Variables are case sensitive, SPEEDC
≠
speedC. Variable names
should not be the same as CDS-3310 instructions. For example, PR is not a good choice for a variable
name.
Examples of valid and invalid variable names are:
Valid Variable Names
POSA
pos1
speedC
Invalid Variable Names
REALLONGNAME
; Cannot have more than 8 characters
123
; Cannot begin variable name with a number
SPEED C
; Cannot have spaces in the name
Assigning Values to Variables
Assigned values can be numbers, internal variables and keywords, functions, controller parameters and
strings;
Summary of Contents for CDS-3310
Page 26: ...18 i Chapter 2 Getting Started CDS 3310 THIS PAGE LEFT PLANK INTENTIONALLY...
Page 32: ...24 i Chapter 3 Connecting I O CDS 3310 THIS PAGE LEFT PLANK INTENTIONALLY...
Page 124: ...CDS 3310 Chapter 8 Hardware Software Protection i 63 THIS PAGE LEFT PLANK INTENTIONALLY...
Page 138: ...CDS 3310 Chapter 10 Theory of Operation i 77 THIS PAGE LEFT BLANK INTENTIONALLY...