Elatec GmbH TWN3A1 User Manual

Page of 44
Elatec GmbH 
Page 40 of 44 
byte ScanHex(byte &Data, byte ByteCnt) 
Convert an array of bytes containing ASCII characters which represent hexadecimal numbers into their 
binary representation. The conversion is done in place. This means that after successful conversion, 
number of valid is half of the given count of ASCII characters (two hex digits represent one binary 
byte). 
Parameters: 
byte &Data
 
Reference to an array of bytes which is the destination for the operation. 
byte ByteCount
 
Number of (ASCII-) bytes to be converted. 
Return: 
Number of successful converted bytes. 
 
7.2.5.7  Timer Operations 
void StartTimer(byte ID, byte Time) 
Start a timer. After the specified time, the timer goes into the timed-out state, which can be tested by 
the function TestTimer. A timer is running in real time in the background. This means, that even if other 
tasks are performed by the script, the time till time-out is still kept correctly. The timed-out state is 
reached only one time. 
Parameters: 
byte ID
 
The ID of a timer which maybe one of the four available timer 0 to 3. 
byte Time
 
The timeout values specified in multiples of 100 milliseconds. 
Return: 
None. 
 
void StopTimer(byte ID) 
Stop a timer. This will prevent a started timer going into timed-out state. It is possible to stop a timer, 
which never has been started or stop an already stopped timer. 
Parameter: 
byte ID
 
The ID of the timer to be stopped in the range of 0 to 3. 
Return: 
None. 
 
byte TestTimer(byte ID) 
Test, if a timer has reached the timed-out state. The timed-out state can only be detected once. After 
that, the timer is stopped. 
Parameter: 
byte ID
 
The ID of the timer to be tested. 
Return: 
TRUE
Timed-out state has been reached. 
FALSE
:  Timer is still running or stopped.