Agilent Technologies E4371A Lawn Mower User Manual


 
6 - Language Dictionary
92
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 bit # value bit # value bit # value
0 1 4 16 8 256 12 4096
1 2 5 32 9 512 13 8192
2 4 6 64 10 1024 14 16,384
3 8 7 128 11 2048 15 32,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);
}