beautypg.com

Count – Remote Processing CAMBASIC User Manual

Page 59

background image

Comm ands - 26

COUNT

Process Function

SYNTAX:

n = count( channel)

PURPOSE:

To retur n the count in the software ev ent counters and r eturn the count of the har dware co unters.

REMARK S:

The C OUN T function retur ns the accum ulated high to low transitions at a s pecified input,
independent of program execution.

The softw are cou nters ar e set up using the O N C OUN T statem ent. channel is the counter number,
and ranges from 0 to 7. The RPC -2350 ranges from 0 to 8. Counter 8 is hardware.

See the Multitasking Chapter for more information.

RELATED:

CLEAR COUNT, CONF IG COUNT, ON COUNT, RESUME COUNT, START COUNT, STOP
C O U N T

EXAMPLE:

10 CONFIG COUNT 0,0,1
20 START COUNT 0
30 PRINT COUNT(0)
40 GOTO 30

This example continiously prints counter 0 value.

ERROR:

< Illegal argument> – if counter> 7
< Data negative> – for counter