Download TelePACE C Tools User Manual

Transcript
counter
Read Counter Input Module
Syntax
#include <ctools.h>
long counter(unsigned counter);
Description
The counter function reads data from the counter input specified by channel. If the channel
number is not valid a COUNTER_BADCOUNTER error is reported for the current task. The
value returned by counter is not valid.
Notes
Refer to the TelePACE Ladder Logic User Manual for an explanation of counter input
channel assignments.
Use offsets from the symbolic constants COUNTER_START and COUNTER_END to
reference counter channels. The constants make programs more portable and protect
against future changes to the counter input channel numbering.
The IO_SYSTEM resource must be requested before calling this function.
This function is provided for backward compatibility. It cannot access all 5000 series I/O
modules. It is recommended that this function not be used in new programs. Instead use
Register Assignment or call the I/O driver ioRead4Counter directly.
See Also
counterError, check_error, request_resource, release_resource, ioRead4Counter
TelePACE C Tools User and Reference Manual
May 9, 2007
99