TCP client module for sending and receiving TCP data in PIXERA.
The module opens a TCP client connection to a configured target IP and port. It can optionally append carriage return (CR) and line feed (LF) delimiters to outgoing messages. When CR and/or LF are enabled, incoming packets are expected to use the same delimiter format.
Usage
Use this module when PIXERA needs to communicate with an external device, application, service, or controller over TCP as a client.
Typical use cases include sending string commands to a TCP server, receiving response messages, and exposing the connection state to other module logic. The module can bind to a selected local adapter and can be initialized manually or through the Auto Init property.
Procedure
- Set
IPto the target TCP server address. - Set
Portto the target TCP server port. - Select
Adapter IPif the machine has multiple network adapters. UseAnywhen no specific local adapter is required. - Enable
Add Carriage Return <CR>and/orAdd Line Feed <LF>if the connected device expects line-delimited commands. - Run
initto start the TCP client connection. - Use
sendwith a string message to transmit data. - Connect logic to
receiveto handle incoming TCP messages. - Use
IsConnectedinternally to read or update the current connection state. - Run
uninitto close the network connection and release the module helper objects.
If send is called while the module is not connected, the module calls init before sending. The configured delimiter is appended to each outgoing message.
Data
Actions
| Action | Info | Input | Output |
|---|---|---|---|
| ref | Returns a reference to the module instance. | - | self |
| init | Initializes the module, loads helper/network libraries, reads properties, configures TCP, sets packet delimiter, and starts the network client. | - | - |
| uninit | Closes the network connection and resets helper, property, init, and lock state. | - | - |
| send | Sends a TCP message. If the module is not connected, it initializes first. The configured delimiter is appended automatically. | msg (string) | - |
| receive | Callback/output action for incoming TCP data. | - | msg (string) |
| IsConnected | Internal status attribute for the TCP connection state. | isConnected (bool), doSet (bool) | connected (bool) |
Properties
| Name | Content | Type Hint | Options Source | Options Action |
|---|---|---|---|---|
| IP | 127.0.0.1 | string | ||
| Port | 4352 | number | ||
| Adapter IP | Any | string | Utils.Network.getLocalAdapterEntries | |
| Add Carriage Return <CR> | true | bool | self.init | |
| Add Line Feed <LF> | true | bool | self.init | |
| Auto Init | false | bool | ||
| Description | TCP client module for sending and receiving TCP data. When sending CR and LF, it is automatically expected that incoming data will also contain CR and/or LF in the same way. | string | ||
| Author | AV Stumpfl GmbH | string | ||
| Logo | Embedded image in module JSON | image | ||
| Url | https://help.pixera.one | url | ||
| Version | 2.4 | number |
Module Version 2.4 | 6 July 2026 | AV Stumpfl GmbH
