Elmo HARSFEN0602, HARmonica software manual Simple Expressions, Assignment Expressions

Models: HARmonica HARSFEN0602

1 220
Download 220 pages 51.63 Kb
Page 27
Image 27

HARSFEN0602ElmoHARmonicaSoftwareManual

PRELIMINARYDRAFT

 

 

 

 

 

 

sin

Sine

Floating point

 

 

 

 

 

 

 

cos

Cosine

Floating point

 

 

 

 

 

 

 

abs

Absolute value

Same type as input argument

 

 

 

 

 

 

 

sqrt

Square root, or zero if argument is

Floating point

 

 

 

negative

 

 

 

fix

Truncate to integer.

Integer

 

 

 

fix(3.8) is 3

 

 

 

 

fix(-3.8) is -3

 

 

 

rnd

Truncate to nearest integer.

Integer

 

 

 

rnd(3.8) is 4

 

 

 

 

rnd(-3.8) is –4

 

 

 

tdif

Time difference

Floating point

 

 

 

x=TM

 

 

 

 

tdif(x ) returns the time in msec since

 

 

 

 

x=TM has been sampled.

 

 

 

 

 

 

 

4.2.6Expressions

An expression is a combination of operands (parameters) and operators that is evaluated in a single value. Expressions work with immediate numbers, Amplifier commands, Amplifier and global user-program variables.

There are different types of expressions, as described below.

4.2.6.1Simple Expressions

A simple expression is evaluated in a single value. Any parameter and mathematical/logical operator may be used to create a simple expression. Normally, simple expressions may be used as a part of other types of expressions.

Simple expressions are evaluated according to the priority of the operators, as specified in Table 4-1 – Mathematical and Logical Operators. In case of equal priority, the expression is evaluated from left to right.

The use of parentheses is allowed to 16 nesting levels.

Example:

AC=100000

SP*2/5+AC SP= SP*2/5+AC IP5 (SP+SP)*IA[1+AC*0] IA[1]5&2

2+3

1400000

4.2.6.2Assignment Expressions

Assignment expressions are used to assign a value to variable or command. The syntax of an assignment expression is:

<Parameter or command name>=<simple expression>

Example:

25

Page 27
Image 27
Elmo HARSFEN0602, HARmonica software manual Simple Expressions, Assignment Expressions