beautypg.com

8 s826_counterpreloadread, 9 s826_counterpreload, S826_counterpreloadread – Sensoray 826 User Manual

Page 42: S826_counterpreload

background image

Return Values

If the function succeeds, the return value is zero.

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

Remarks

The counts value is immediately written to the selected preload register when this function executes. The counter core
is not affected until the next core preload occurs.

7.3.8 S826_CounterPreloadRead

The S826_CounterPreloadRead function reads a preload register.

int S826_CounterPreloadRead(
uint board, // board identifier
uint chan, // channel number
uint reg, // register identifier
uint *counts // counts value
);

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.

reg

Selects the preload register to write to: 0 = Preload0 register, 1 = Preload1 register.

counts

Pointer to a buffer that will receive the counts from the selected Preload register.

Return Values

If the function succeeds, the return value is zero.

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

7.3.9 S826_CounterPreload

The S826_CounterPreload function manually invokes a core preload from the Preload0 register.

int S826_CounterPreload(
uint board, // board identifier
uint chan, // channel number
uint level, // preload signal level
uint sticky // make level "sticky"
);

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.

level

Effective preload signal level: 1 = invoke preload, 0 =don't invoke preload. This is ignored if sticky=0.

sticky

Persistence: 1 = maintain level until reprogrammed, 0 = strobe trigger (level is ignored).

826 Instruction Manual

37

Counters