Agilent Technologies E4374A cfSetDigitalPort, cfSetErrorFunction, Syntax, Description, See Also

Models: E4374A E4371A E4370A

1 141
Download 141 pages 7.46 Kb
Page 92
Image 92
cfSetDigitalPort

6 - Language Dictionary

cfSetDigitalPort

Syntax

int cfSetDigitalPort(CF_HANDLE server, int data);

Description

Write data to the digital I/O port. Data must be sent as the equivalent of a 16-bit binary word. For example, sending a value of 0 sets all bits low. Sending a value of 65,535 sets all bits high. Use the following values to set individual digital I/O bits:

bit #

value

01

12

24

38

bit #

value

416

532

664

7128

bit #

value

8256

9512

101024

112048

bit #

value

124096

138192

1416,384

1532,768

Combine the above values to program multiple bits. For example, to set bits 3, 7, 10, and 11, send 3208 (8 + 128 + 1024 + 2048).

See Also

cfGetDigitalPort, cfGetDigitalConfig

cfSetErrorFunction

Syntax

int cfSetErrorFunction(void(*ErrorFn)(CF_HANDLE server, char *name, int errorcode));

Description

Defines an error function that will be called by other instrument functions when they detect a non-zero return value. The argument ErrorFn is a pointer to a function returning void with 3 arguments. The application program can use this mechanism to be notified whenever a error value is returned from any of the Agilent MCCD library functions.

A null pointer can be passed as the ErrorFn argument function, in which case the error callback mechanism is turned off.

If a library function that does not have a server handle argument returns an error; the error function will be called with the server parameter value of CF_NULL_SERVER.

Example

void report_mccd_error(CF_HANDLE server, char *name, int error)

{

printf("MCCD server returned error %d from API function %s\n", error, name);

}

main()

{

/* Initialization code not shown here. */ cfSetErrorFunction(report_mccd_error);

}

92

Page 92
Image 92
Agilent Technologies E4374A, E4370A, E4371A cfSetDigitalPort, cfSetErrorFunction, Syntax, Description, See Also, Example