C Control The I Unit-M Advanced 5 Vdc Inputs / outputs 16 x digital I/Os / 8 x analogue or digital I/Os Program memory 2 198805 Fiche De Données

Codes de produits
198805
Page de 42
ABS 
The ABS function returns absolute value of a word or byte size value. It works for bytes but usually it makes 
no sense because byte values are unsigned 
MyWord=ABS(MyWord) 
 
Syntax: Variable = ABS(value1)  
 
 Variable: Variable of Byte oder Word type  
 value1: Variable, value oder constant of Byte oder Word type  
  
 
SGN 
The SGN function returns 1 if the value is >0 and -1 if the value is <0. It works for bytes also but usually it 
makes no sense because byte values are unsigned 
 
MyWord=SGN(MyWord) 
Syntax: Variable = SGN(value1)  
 
 Variable: Variable of Byte oder Word type  
 value1: Variable, value oder constant of Byte oder Word type  
  
 
RAND 
RANDOMIZE 
The RAND function returns a random word value. The values will be random, but the sequence of random 
values will always be the same unless you use RANDOMIZE X for different initialisations. 
RANDOMIZE TIMER will load the running system timer as initialisation 
 
 
RANDOMIZE 2000 
MyWord=RAND 
Syntax:    RANDOMIZE init 
                Variable = RAND
  
 
 Variable: Variable of Byte oder Word type  
 init:         Variable or constant of Byte or Word type     
  
 
SQR 
The SQRT function returns an aproximated value of the squareroot.  
 
MyWord=SQRT(MyWord) 
Syntax: Variable = Sqrt(value)  
 
  Variable: Variable of Byte oder Word type  
  Value: Variable, value or constant of Byte or Word type.  
 
 
MOD 
The MOD (Modulo) function returns the remainder of an integer division.  
 
MyWord=MyByte1 MOD MyByte2) 
Syntax: Variable = value1 MOD value2 
 
 Variable: Variable of Byte oder Word type  
 value1 Variable, value oder constant of Byte oder Word type  
 value2 Variable, value oder constant of Byte oder Word type 
 
 
 
 
 
 
 
 
 
 
17