WireWare native: WireWare OpenMachineNode

From FactorityWiki

Jump to: navigation, search

Contents

Summary

Searches a node for a specified machine or device and opens it.


WIREWARE_RESULT WireWare_OpenMachineNode (
WIREWARE_NODE_ID nodeID // node ID
WIREWARE_CSTR name // machine's name
WIREWARE_INT flags // flags for the open command
PWIREWARE_MACHINE_HANDLE handle // pointer to handle
WIREWARE_TIMEOUT timeout // timeout in ms
);

Parameters

nodeID
Specifies the node ID which should be searched for the machine or device.
name
Specifies the name of the machine or device, which should be opened.
flags
Specifies flags for the open command. The flags value can be any combination of the WIREWARE_MACHINE_FLAGS_xxxx constants.
WIREWARE_MACHINE_FLAGS_MIRRORED: Opens a machine or device, which has been created by specifying the "mirrored" flag (see WireWare_CreateMachine_I).
handle
Specifies a pointer to a memory location, which recieves the handle of the opened machine connection.
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 searches the specified node for a machine or device with the given line ID and machine number and opens it.
If no appropriate machine or device has been found, the function always times out. In this case the function blocks always the for time, which has been specified in the timeout parameter. The functions result is WIREWARE_ERROR_TIMEOUT in this case.
The returned handle has to be closed by calling the function WireWare_CloseMachine.

See also

WireWare_OpenMachine, WireWare_OpenMachineID, WireWare_OpenMachineNodeID, WireWare_OpenMachineDriver, WireWare_CloseMachine