cbDaqSetSetpoints()

Configures up to 16 detection setpoints associated with the input channels within a scan group. This function only works with boards that support synchronous input.

Function Prototype

C/C++

int cbDaqSetSetpoints(int BoardNum, float *LimitAArray, float *LimitBArray, float *reserved, int *SetpointFlagsArray, int *SetpointOutputArray, float *Output1Array, float *Output2Array, float *OutputMask1Array, float *OutputMask2Array, int SetpointCount);

Visual Basic

Function cbDaqSetSetpoints(ByVal BoardNum&, LimitAArray!, LimitBArray!, Reserved!, SetpointFlagsArray&, SetpointOutputArray&, Output1Array!, Output2Array!, OutputMask1Array!, OutputMask2Array!, ByVal SetpointCount&) As Long

Arguments

BoardNum

The number associated with the board when it was installed with InstaCal or created with cbCreateDaqDevice(). BoardNum may be 0 to 99. The board must support synchronous input.

LimitAArray

Array containing the limit A values for the input channels used for the setpoint. Limit A specifies a value used to determine if the setpoint criteria are met.

LimitBArray

Array containing the limit B values for the input channels used for the setpoint. Limit B specifies a value used to determine if the setpoint criteria are met.

Reserved

Reserved for future use.

SetpointFlagsArray

Array containing the setpoint flags. Set to one of the constants in the SetpointFlagsArray argument values section below.

SetpointOutputArray

Array containing output sources. Set to one of the constants in the SetpointOutputArray argument values section below.

Output1Array

Array containing the values for the output channels used for the setpoint.

Output2Array

Array containing the values for the output channels used for the setpoint.

OutputMask1Array

Array containing the output masks for output value 1 (for FIRSTPORTC only).

OutputMask2Array

Array containing the output masks for output value 2 (for FIRSTPORTC only).

SetpointCount

Number of setpoints to configure (0 to 16). Set to 0 to disable the setpoints.

Returns

SetpointFlagsArray argument values

FlagDescription
SF_EQUAL_LIMITASetpoint criteria: The input channel = limit A.
SF_LESSTHAN_LIMITASetpoint criteria: The input channel < limit A.
SF_GREATERTHAN_LIMITBSetpoint criteria: The input channel >limit B.
SF_INSIDE_LIMITSSetpoint criteria: The input channel > limit A and < limit B.
SF_OUTSIDE_LIMITSSetpoint criteria: The input channel < limit A and > limit B.
SF_HYSTERESISSetpoint criteria: If the input channel > limit A then output value 1.
If the input channel < limit B then output value 2.
SF_UPDATEON_TRUEONLYIf the criteria is met then output value 1.
SF_UPDATEON_TRUEANDFALSEIf the criteria is met then output value 1, else output value 2.

SetpointOutputArray argument values

Output sourceDescription
SO_NONEPerform no outputs.
SO_FIRSTPORTCOutput to FIRSTPORTC when the criteria is met.
SO_DIGITALPORTOutput to digital port when the criteria is met.
SO_DAC0Output to DAC0 when the criteria is met. You must have a device with DAC0.
SO_DAC1Output to DAC1 when the criteria is met. You must have a device with DAC1.
SO_DAC2Output to DAC2 when the criteria is met. You must have a device with DAC2.
SO_DAC3Output to DAC3 when the criteria is met. You must have a device with DAC3.
SO_TMR0Output to timer 0 when the criteria is met.
SO_TMR1Output to timer 1 when the criteria is met.