beautypg.com

13 s826_counterextinroutingread, 14 s826_countersnapshotconfigwrite, S826_counterextinroutingread – Sensoray 826 User Manual

Page 45: S826_countersnapshotconfigwrite

background image

route

Signal to be connected to ExtIn (this is ignored if mode register field IM=0):
0 to 47 = DIO channel 0 to 47;
48 to 53 = counter channel 0 to 5 ExtOut;
54 to 59 = virtual digital output channel 0 to 5.

Return Values

If the function succeeds, the return value is zero.

If the function fails, the return value is an error code.

Remarks

This function will route the counter channel's ExtIn input to a general-purpose digital I/O (DIO) channel so that an
external signal (applied to the DIO channel's I/O pin) can control the channel's ExtIn input. Alternatively, the ExtIn
input may internally routed to any counter channel's ExtOut output, or to any virtual digital output channel.

7.3.13 S826_CounterExtInRoutingRead

The S826_CounterExtInRoutingRead function returns a counter channel's ExtIn signal routing configuration.

int S826_CounterExtInRoutingRead(
uint board, // board identifier
uint chan, // counter channel number
uint *route // routing configuration
);

Parameters

board

826 board number. This must match the settings of the board's dip switches as described in section 2.2.

chan

Counter channel number in the range 0 to 5.

route

Pointer to buffer that will receive the ExtIn routing configuration. The format of the returned value is identical to the
route argument used in the S826_CounterExtInRoutingWrite function.

Return Values

If the function succeeds, the return value is zero.

If the function fails, the return value is an error code.

7.3.14 S826_CounterSnapshotConfigWrite

The S826_CounterSnapshotConfigWrite function programs the snapshot configuration register.

int S826_CounterSnapshotConfigWrite(
uint board, // board identifier
uint chan, // counter channel number
uint cfg, // snapshot configuration flags
uint mode // 0=write, 1=clear bits, 2=set bits
);

Parameters

board

826 board number. This must match the settings of the board's dip switches as described in section 2.2.

chan

Counter channel number in the range 0 to 5.

826 Instruction Manual

40

Counters