With this guide you'll quickly:
- Launch JAMBUI for a quick start view of your device.
- Integrate 2G auto-registermaps into your own application.
- Explore sample scripts for Python, Web, and CLI demos.
Use JAMBUI to explore 2G devices and their register map.
1. Download & Install
- Visit: https://www.2g-eng.com/subsea-products/product-support/
- Download the latest JAMBUI installer (Windows/macOS/Linux).
- Run the installer or unzip the package.
2. Launch
- On Windows: double-click JAMBUI.exe
- On macOS/Linux: run
jambuifrom your applications menu or shell.
3. Connect to Your 2G Device
- Switch to the Setup tab.
- Under Communication, set port parameters:
- Serial: COM/tty port, baud rate, parity, stop bits, unit ID
- TCP: IP address, port, unit ID
- Click Connect.
- JAMBUI will automatically display the register map from the 2G device.
Explore jambui's help menu for additional usage information.
Before you go further, make sure you are familiar with the Modbus protocol: https://www.modbus.org/docs/Modbus_Application_Protocol_V1_1b3.pdf
Integrating Modbus devices into modern systems can be time-consuming. Numeric register addresses, mixed-size fields, and custom packing introduce errors and slow development. Developers often spend hours hunting down register definitions and writing glue code to translate raw bytes into meaningful engineering values.
2G's Regmap streams a UUID-tagged, self-describing CSV map via register 130. It details names, types, scales, and packing so you can:
- Read and write registers by name
- Cache maps on reconnect
- Focus on your application, not low-level parsing
2G's Modbus protocol lets your host application download the device's register map on startup. On subsequent connections, a UUID check lets you reuse a cached map and speed up initialization.
Code examples:
jambapi.py
- Open a serial or TCP socket link to the device, specifying port settings (baud rate, parity, stop bits, unit ID).
- Once the port is open, you're ready to issue Modbus requests.
- Write the ASCII text
-1into holding register 130. This resets the REGMAP read pointer. - Repeatedly read a 120-word block from register 130.
- Split the returned string on null (
\0) bytes to recover line breaks. - When a read returns an empty first line, the transfer is complete.
- Lines beginning with
# title :name the device. - Lines beginning with
# uuid :contain a unique identifier that you'll use for caching.
Each non-comment line in the CSV map has these comma-separated fields:
- Register address (decimal)
- Words to read (word count)
- Words to write (word count)
- Persist flag (
0or1) - Register name (string)
- Packing specifier (endianness + type + optional scale/offset)
- Unit (e.g.
V,A) - Print format (e.g.
"{value:.2f}") - Hint/description/tag
Example line:
42,2,2,0,TEMPERATURE,>f,C,"{value:.1f}","Temperature reading@sensor"
- Look up the register entry by its name.
- Send a Modbus Read Holding Registers request using the register's address and word count.
- Concatenate the returned 16-bit words into a byte stream.
- Unpack the bytes according to the packing specifier.
- Apply scale and offset to compute the final value.
- Look up the register entry by its name.
- Send a Modbus Write request with the appropriately packed bytes.
Caching the CSV map locally greatly speeds up reconnects. Your client should:
- While downloading the map, parse the header's UUID.
- If a local file named
<UUID>.csvexists, load that instead of streaming. - Otherwise, perform the live download and save it as
<UUID>.csv. - Parse the loaded CSV into your in-memory register table.
-
Connects to serial devices, reads map, reads/writes registers
-
Less than 500 lines of code
-
If device has a UUID, the API will use or save a map cache CSV
-
Key functions:
read_regmap_from_device(): Reads the register map from 2G devices and auto-switches to cached map when UUID is detectedportay(): Formats register values for display
-
Demo of a web interface using the API
-
Files used:
jambweb.pyjambweb_template.htmljambapi.py
-
Demo of a command-line interface using the API
-
Less than 300 lines of code
-
Screenshot preview below
-
Files used:
jambmon.pyjambapi.py
- Connects to a serial or USB 2G Modbus device and saves the register map to
registerMap.csv
