DR_ApWritePoint
DR_ApWritePoint — writes a new value to a point.
Syntax
#include <cogent.h>
int DR_WritePoint( | char* | pnt_name, |
| | int | pnt_type, |
| | DR_ApValue_t* | pnt_value, |
| | char** | error); |
Arguments
- pnt_name
- A
string containing the name of the required
point.
- pnt_type
- The point type code. The list of defined
driver data point types is described in the Overview section of the Device
Driver for Hilscher Fieldbus Cards manual.
- pnt_value
- A pointer to the memory area containing the
point value, of the same type as specified in
pnt_type.
- error
- The
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.
Returns
The integer value
0 if the point was updated successfully,
otherwise the following error code is returned:
DR_ERR_PNT_NOT_WRITEABLE
Description
This function writes a new value
to the named point. The field I/O is updated immediately, unless
the point is a member of a writeable group, in which case it is
updated when the group is processed.
Example
int result;
DR_ApValue_t value;
char *error_str, *name = "Red_Light1";
value.s = 1;
result = DR_ApWritePoint (name, DR_API_BIT_TYPE, &value,
&error_str);