TcpServer opens a TCP server on a selected local network adapter and port. It reports incoming messages and connection handles, allowing PIXERA Control logic to reply to individual TCP clients.
Usage
Use TcpServer when an external device or application must connect to PIXERA over TCP. The module listens for client connections, reports received messages through the receive Action, and sends responses through the send Action.
Incoming data can be packetized with carriage return, line feed, or a combination of both. The same configured delimiter is appended automatically to outgoing messages.
Setup
- Set Adapter IP to the local network adapter on which TcpServer should listen. Use Localhost when connections are only required from the same computer.
- Set Port to an available whole-number TCP port from
1to65535. - Configure
Add Carriage Return <CR>andAdd Line Feed <LF>to match the delimiter required by the connecting TCP client:
- Enable only
Add Carriage Return <CR>forCR. - Enable only
Add Line Feed <LF>forLF. - Enable both for
CRLF. - Disable both when no delimiter-based packetizing is required.
- Run the
initAction, or enable Auto Init to initialize the module automatically. - Connect the output of the
receiveAction to the required Control logic. Itshdloutput identifies the client connection that supplied the message. - Pass the required connection handle and message to the
sendAction to reply to a client. - Run the
uninitAction before changing connection settings, or runinitagain after applying the new settings.
The selected TCP port must not already be in use by another application. Firewalls and network configuration must also permit connections to the selected adapter and port.
Features
- Listens for multiple TCP client connections on a configurable local adapter and port.
- Reports the current server state through the
isOpenAction. - Reports the number of active client connections through the
connectionCountAction. - Outputs incoming messages together with their client connection handles.
- Sends messages to a specific client by connection handle.
- Supports
CR,LF,CRLF, or no delimiter. - Applies the configured delimiter to both incoming packetizing and outgoing messages.
- Validates that the configured port is a whole number from
1to65535.
Actions
| Action | Info | Input | Output |
|---|---|---|---|
| init | Initializes TcpServer using the current Properties and starts listening for TCP clients. | - | - |
| uninit | Closes the TCP server, disconnects its network process, and clears its runtime values. | - | - |
| send | Sends a message to a specific TCP client. The configured delimiter is appended automatically. | hdl (handle), msg (string) | - |
| receive | Reports a message received from a TCP client and the handle required to reply to that client. | - | msg (string), hdl (handle) |
| isOpen | Reports whether the TCP server is currently open. This is an internal Attribute Action. | newState (bool), doSet (bool) | result (bool) |
| connectionCount | Reports the current number of connected TCP clients. This is an internal Attribute Action. | currentCount (int), doSet (bool) | result (int) |
Properties
| Name | Content | Type Hint | Options Source | Options Action |
|---|---|---|---|---|
| Port | 15151 | int | - | - |
| Adapter IP | Localhost | - | Utils.Network.getLocalAdapterEntries | - |
Add Carriage Return <CR> |
TRUE | bool | - | - |
Add Line Feed <LF> |
TRUE | bool | - | - |
| Auto Init | FALSE | bool | - | - |
| Description | Starts a TCP server on the selected local adapter and port. Reinitialize the module after changing its connection settings. | string | - | - |
| Author | AV Stumpfl GmbH | string | - | - |
| Logo | PIXERA Logo | image | - | - |
| Documentation | - | documentation | - | - |
| Version | 1.4 | string | - | - |
Changelog
1.4
- Aligned Action and Property naming, ordering, and slot styles with the Control Module standards.
- Added the required Description and Documentation Properties.
- Removed duplicate helper creation and routine runtime logging.
- Added validation for the configured port and safe checks for message sending.
- Kept Lua fallback values consistent with the exported Property defaults.
Module Version 1.4 | 30 July 2026 | AV Stumpfl GmbH
