WireWare native: WireWare OpenMachineID

From FactorityWiki

Jump to: navigation, search

Contents

Summary

Searches the network for a specified machine or device and opens it.


WIREWARE_RESULT WireWare_OpenMachineID (
WIREWARE_LINE_ID lineID // machine's line ID
WIREWARE_MACHINE_NR machineNr // machine's number
WIREWARE_INT flags // flags for the open command
PWIREWARE_MACHINE_HANDLE handle // pointer to handle
WIREWARE_TIMEOUT timeout // timeout in ms
);

Parameters

lineID
Specifies the line ID of the machine or device, which should be opened.
machineNr
Specifies the number 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 network for a specified machine or device 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_OpenMachineNode, WireWare_OpenMachineNodeID, WireWare_OpenMachineDriver, WireWare_CloseMachine