Collect your first point
Use the built-in protocol simulator to create a register containing 1234, then read it through Collection Configuration. This exercise needs no PLC or separate Modbus software. MQTT, history, and rules can be added after the first reading works.
Follow Quick Start to start TGateway and sign in. All steps below use the same Runtime; Studio is not required.
Prepare the simulated source
1. Create the simulated slave
Open Development Configuration → Protocol Simulator. On an empty page, select New Channel; otherwise use the plus button beside the channel list.
Enter the channel name and plugin on Channel Configuration, then open Transport Configuration and Modbus Configuration.
| Setting | Value for this exercise |
|---|---|
| Channel name | Demo_Modbus_Simulator |
| Protocol plugin | Modbus Slave |
| Channel type | TCP Service |
| Listen address | 127.0.0.1 |
| Port | 15030 |
| Frame format | Modbus TCP |
| Station number | 1 |
Keep other settings at their defaults. Save the channel and leave it stopped while adding the variable. Stop it before reopening its configuration later.
127.0.0.1 refers to the machine running Runtime, even when your browser runs elsewhere. If port 15030 is occupied, choose a free port and use the same port in the collection channel below.
2. Add a fixed source value
Select the simulator channel, open Variables, and click the plus button for Add Variable.
| Setting | Value for this exercise |
|---|---|
| Variable name | SourceValue |
| Protocol address | S=1;F=3;0 |
| Data type | Int16 |
| Array length | 1 |
| Initial value | 1234 |
| Data-change designer: enable automatic changes | Off |
The address assistant can generate the same address: station 1, holding register, offset 0. Keep other settings unchanged. Save the variable and start the simulator channel. Confirm that it is running and the source value is 1234.
Configure the collection path
3. Create the collection channel
Open Development Configuration → Collection Configuration and click Add Channel at the top left.
| Setting | Value for this exercise |
|---|---|
| Channel name | Demo_Modbus_Channel |
| Channel type | TCP client (TcpClient) |
| Remote address | 127.0.0.1:15030 |
| Enable | On |
| Cache timeout | Keep the default 500 ms; do not enter 0 |
Keep the other timeout, heartbeat, and concurrency settings at their defaults, then confirm. Reopen the channel through More → Edit Channel when you need to check it.
The simulator listens as a TCP server; this collection channel connects as a TCP client. Verify the direction at both ends.
4. Create the collection device
Click Add Device at the top left. On Basic Information, enter a name, select the plugin, and associate the collection channel.
| Setting | Value for this exercise |
|---|---|
| Device name | Demo_Modbus_Device |
| Associated channel | Demo_Modbus_Channel |
| Device plugin | Modbus Master |
| Execution interval | 1000 ms |
| Enable | On |
| Plugin properties: Modbus type | Modbus TCP |
| Plugin properties: default station | 1 |
| Plugin properties: DTU ID | Empty |
After choosing the plugin, open Plugin Properties and check Modbus TCP, station 1, and the empty DTU ID. Keep other settings at their defaults and confirm.
5. Add the collection point
Select Demo_Modbus_Device in the left tree, then click Add Variable above the variable table.
| Setting | Value for this exercise |
|---|---|
| Variable name | Demo_Modbus_Value |
| Device | Demo_Modbus_Device |
| Variable address | 40001 |
| Data type | Int16 |
| Enable | On |
| Array length | Keep 0 for a scalar collection value |
| Read/write expressions | Empty |
Confirm to return to the variable table. For a collection-only point, use read-only access.
40001 selects the first holding register, matching simulator address S=1;F=3;0. Its protocol offset is 0. Start with this one known point before adding a larger point table.
Verify the reading and continue
6. Check the reading
Wait one or two collection cycles, refresh the table, and locate Demo_Modbus_Value. Verify all three results:
- The variable is online and healthy.
- Its current value is
1234, matching the simulator. - Its collection time keeps advancing.
| Unexpected result | Check |
|---|---|
| Device cannot connect | Simulator is running; both ends use the same port |
| Read fails | Station 1, source S=1;F=3;0, collection address 40001 |
| Value differs from 1234 | Both types are Int16; source initial and current values are correct |
| Point is missing | Selected device and any name/status filters |
Continue when needed
| Next task | Guide |
|---|---|
| Connect a physical device | Modbus Master: replace the endpoint, station, and addresses with the actual point table |
| Forward this value to MQTT | MQTT Client Producer: prepare a reachable broker |
| Save local history | Historical Data Storage: SQLite can be used without a separate database service |
| Convert 1234 to 123.4 | Script Management |
| Evaluate a condition | Rule Engine |
| Import more points | Excel import/export |
| Build a complete project | Project configuration and delivery |
Finish the exercise
Keep the configuration if you want to continue later. To release the listening port, disable the demonstration collection device first, then stop Demo_Modbus_Simulator in Protocol Simulator.
Before deleting demonstration objects, remove any forwarding, script, or rule references you added. Select the individual demonstration objects for cleanup.





