XPS Unified Programmer’s Manual
7.2.1.33 ExternalModuleSocketReserve
Name
ExternalModuleSocketReserve – Reserves the current socket for an ExternalModule.
Input tests
- Refer to section 7.1: “Input Tests Common to all XPS Functions”.
- Checks the module number (must >=1 and <= NbExternalModules): (-17)
Here: NbExternalModules is the number of modules declared in the line
SharedLibraryModuleNames of system.ref
- Checks if the current socket is already reserved for another ExternalModule: (-22)
- Checks if the ExternalModule has already been linked with another socket: (-22)
Description
• To be able to execute the own API functions of an ExternalModule via a TCP
Terminal, the user must reserve a socket for this ExternalModule.
• This function reserves the current socket for an ExternalModule. If the function is
executed successfully, via this socket the own ExternalModule functions (like
ExternalModuleTZPositionCurrentGet(), ExternalModuleGPIODigitalInputGet(),
…) become functioning, whereas the controller functions (like
FirmwareVersionGet(), ElapsedTimeGet() , ErrorStringGet(), …) become inactive
(return Unknown command).
Prototype
int ExternalModuleSocketReserve(
int SocketID,
int ModuleNumber
)
Input parameters
SocketID int Socket identifier gets by the
“TCP_ConnectToServer” function.
ModuleNumber int External module number
Output parameters
None
Return (In addition to the results of “Input Tests Common to all XPS
Functions”)
• 0: No error.
• -17: Parameter out of range or incorrect.
• -22: Not allowed action.
79 EDH0373En1023 — 01/18