Compatible Devices
Devices supporting Modbus, as slaves, via Serial and TCP [g3-phoenix...tactnanolc | Word]
Verified Device
Phoenix Contact nLC-50 [g3-phoenix...tactnanolc | Word]
Device Configuration
Opening the device provides selectable configuration options for both Serial and TCP/IP connections. [g3-phoenix...tactnanolc | Word]
Accessible Data
| Prefix | Description | Data Type | Notes |
|---|---|---|---|
| R | Holding Registers | Long | 1 |
| Q | Digital Outputs | Bit | 2 |
| I | Digital Inputs | Bit | 3 |
| F | Flags | Bit | 4 |
| TCA | Timer/Counter Accumulated | Long | 5 |
| TCP | Timer/Counter Preset | Long | 6 |
| OTA | Output Time Accumulated | Long | 7 |
| OTP | Output Time Preset | Long | 8 |
| HSA | High Speed Accumulated | Long | 9 |
| HSP | High Speed Preset | Long | 10 |
| A | Analog Input | Word | 11 |
| O | Analog Output | Word | 12 |
| M | Direct Modbus Addressing | Word | 13 |
General Information
The nanoLC does not support the full Modbus address range; the programmer must ensure address validity for the connected device. [g3-phoenix...tactnanolc | Word]
This driver uses:
- Zero-based addressing (standard Modbus is one-based)
- Subtract 1 from the Modbus address when configuring
Examples:
- Holding Register 40043 → use M42
- For 32-bit access → use R21
A Long value uses two consecutive 16-bit registers:
- Low word →
n * 2 - High word →
(2 * n) + 1[g3-phoenix...tactnanolc | Word]
Function Codes
-
Long
- Read: Function 3
- Write: Function 16
-
Word
- Read: Function 3
- Write: Function 6 or 16
- Analog Input uses Function 4
-
Bit
- Write: Function 5 or 15
- Read: Depends on type
Timer/Counter Data Handling (TCA / TCP)
Read format:
Hours = Value >> 16 Minutes = (Value >> 8) & 0xFF Seconds = Value & 0xFF
Convert to seconds:
T = (Hours * 3600) + (Minutes * 60) + Seconds
Write format:
(Hours << 16) + (Minutes << 8) + Seconds
Notes (Summary)
- R → Uses two registers (low/high)
- Q → Digital outputs (FC 1, 5, 15)
- I → Read-only digital inputs (FC 2)
- F → Internal bits (base address 0x1000)
- TCA/TCP → Timer/Counter values (see base addresses)
- OTA/OTP/HSA/HSP → Time and high-speed registers with defined Modbus base addresses
- A → Analog input (read/write allowed but typically read)
- O → Analog output (base address 0x1000)
- M → Direct Modbus register access (16-bit) [g3-phoenix...tactnanolc | Word]
RS-232 Connections (RJ-11)
| G3 | Signal | nanoLC |
|---|---|---|
| 2 | Rx ↔ Tx | 2 |
| 5 | Tx ↔ Rx | 3 |
| 3/4 | 0V | 4 |
© HMS Networks AB 2025