WireWare native: WireWare CreateDatapoint I

From FactorityWiki

Jump to: navigation, search

Contents

Summary

Creates a new datapoint for the machine.


WIREWARE_RESULT WireWare_CreateDatapoint_I (
WIREWARE_MACHINEI_HANDLE hMachine, // Handle for machine
WIREWARE_CSTR name, // Name of the new datapoint
WIREWARE_DATAPOINT_TYPE type, // Type of the new datapoint
WIREWARE_INT length, // Length of the new datapoint
PWIREWARE_DATAPOINTI_HANDLE handle, // Pointer to memory location for datapoint handle
WIREWARE_TIMEOUT timeout, // timeout in ms
);

Parameters

hMachine
Specifies the handle of the machine for which a datapoint should be created.
name
Specifies the name of the datapoint, which should be created.
type
Specifies the type of the datapoint, which should be created. Use any of the constants WIREWARE_DATAPOINT_TYPE_XXXX .
length
Specifies the length (in bytes) of the datapoint, which should be created. Zero specifies the datapoint types default length, e.x. 4 for WIREWARE_DATAPOINT_TYPE_INT.
handle
Points to a memory location, to which the handle of the datapoint is copied, if the datapoint has been created successfully.
timeout
Specifies the maximum allowed execution time (in ms) for this function.

Result

If the function succeeds, the return value is WIREWARE_ERROR_NONE. Otherwise it returns an appropriate error code.


Explanation

This function creates a new datapoint for the machine, which can be accessed remotely.
If the datapoint is of the type WIREWARE_DATAPOINT_TYPE_STREAM a streaming function has to be set by WireWare_SetDatapointStreamingFunc_I.
You can modify the datapoints attribute by calling WireWare_SetDatapointAttribute_I.

See also

WireWare_CloseDatapoint_I, WireWare_CreateMachine_I, WireWare_CreateMachineID_I, WireWare_SetDatapointStreamingFunc_I, WireWare_SetDatapointAttribute_I