3 tips on programming – Alpha Technologies Cordex Controller Ver.2.0 User Manual

Page 90

Advertising
background image

Refer to the back of this manual for Factory Service and Technical Support contact information

Alpha Technologies Ltd.

034-136-C0 Rev B WC

Printed in Canada. © 2010 Alpha Technologies Ltd. ALPHA and CORDEX are trademarks of Alpha Technologies Ltd. All Rights Reserved.

Page 88 of 122

Figure 98–Equation builder keypad symbol key

Figure 99–Equation builder keypad function keys

7.3

Tips on Programming

Square parenthesis [ ] are reserved for CXC signal names.

Use only round parenthesis ( ) for manipulating the order of operations in an equation.

The counters will increment approximately every half-second by default. A cascading counter can be written to
create a longer time between increments.

Here is a delay counter for AC fail alarm. The “AC Fail Delay” works by counting up from 0 to 30 when Rect. AC
Mains Fail alarm is true. When Rect. AC Mains Fail is false it will count down to 0.

[AC Fail Delay] + ( ( [AC Fail Delay] < 30) * [Rect. AC Mains Fail] ) - ( ( [AC Fail Delay] > 0 ) *
![Rect. AC Mains Fail] )

Here is a custom signal set up to filter the battery voltage. "Filtered Battery Voltage" is the custom signal name:

( ( [Filtered Battery Voltage] * 15 ) + [Battery Voltage] ) / 16

Keypad changed from numeric to symbol

Select Sym
for mathematical and logic operators
[select 123 to return to numeric keypad]

Select + key for addition function

Mathematical operators:
+ = Add
- = Subtract
* = Multiply
/ = Divide

Logical operators:
& = AND
| = OR
! = NOT TRUE
= is EQUAL THAN (compare for equality)
> is GREATER THAN
< is LESS THAN
( is OPEN PARENTHESIS (used with a
close parenthesis to set apart arguments to
a mathematical function)
) is CLOSE PARENTHESIS (see open
parenthesis; used to clarify the order of
operations)

Advertising