#include <cogent.h>
int DR_ApDescribePnt(
char* pnt_name, int* pnt_type, int* enabled, int* readable, int* writeable, char* address, int addr_len, char** error )
;
A string containing the name of the required point.
If not NULL and the point is defined, then the type of the point is returned here. The following point types are defined (see dr_api.h):
* DR_API_DOUBLE_TYPE * DR_API_INT16_TYPE * DR_API_BIT_TYPE
If not NULL and the point is defined, then the status of the point is returned here, 1 if enabled, 0 if disabled.
If not NULL and the point is defined, then 1 is returned if the point is configured as readable.
If not NULL and the point is defined, then 1 is returned if the point is configured as writeable.
If not NULL, the address of a string to be set to the point's address string, as specified during the configuration.
The maximum length of the address string. Although addressing requirements vary with the type of driver and point, 16 characters is usually sufficient.
Address of a string pointer, in case of error (non-zero return), the string pointer is set to the corresponding error description string. The error string is contained in a static buffer and remains valid only until the next API call. The parameter may be NULL if no error string is required.
The integer value 0 if the point was accessed successfully, otherwise one of the following error codes:
DR_ERR_PNT_NOT_FOUND DR_ERR_PNT_NOT_ENABLED DR_ERR_PNT_NOT_READABLE DR_ERR_PNT_TYPE_NO_REP DR_API_STATUS_ERRORS DR_API_IPC_ERRORS
int enabled, readable, writeable, type; char *name = "counter"; char address[16]; char *error_str; if result = DR_ApDescribePoint (name, &type, &enabled, &readable, &writeable, address, sizeof(address), &error_str)) { printf (" Error@DescribePoint (%d, %s)\n", result, error_str); } else { printf (" Point %s: type %d, %s%s, addr: %s\n", test_pnt, type, (readable?"R":""), (writeable?"W":""), address); }
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.