DALI · How-to guides
Import Modbus queries from CSV
Set up many Modbus master queries at once from a CSV file, and export the queries a station already has.
Goal: the station's Modbus master queries match a CSV file you prepared, on every bus at once.
Before you start
- You need the Admin role.
- A spreadsheet editor that can save CSV.
- The device details for each query, as for Add a Modbus sensor.
Steps
- 1
Get a file to start from. On Modbus, click Download Template for an empty file with instructions and sample rows, or Export Queries (CSV) to get the queries already on the station.
- 2
Fill in one row per query. The Type column picks the bus:
TCP,RS232,RS485orRS485_M2(the second RS485 port). The other columns are InUse, SlaveID, FunctionCode, Address, Quantity, BaudRate, Parity, Stopbits, txMode, SlaveIpAddress, SlavePort, ConnectTimeout, ResponseTimeout and Retries, with the same limits as the query form. Leave the TCP columns blank on serial rows and the serial columns blank on TCP rows. Lines starting with#are ignored. - 3
Open the import window. Click Import Queries (CSV) and choose the file.
- 4
Choose how to merge. Pick a Conflict mode:
- Add only (skip duplicates) keeps what is there and adds new queries.
- Update existing + add new changes matching queries and adds the rest.
- Replace all (remove queries not in this file) makes the station match the file exactly.
- 5
Import. Click Import. Every row is checked and the good ones are imported. In Replace mode, the window first lists the queries that will be deleted; press Delete listed queries & import to go ahead.
Check it worked
The result table shows each line as imported or failed, and the query lists on each master tab show the new queries. Turn on Enable for any bus that was off, then map the registers to parameters. See Create a parameter.
If something goes wrong
- Some rows failed. Read the reason on each line. Click Retry failed to try them again, or Download failed rows, fix them and import that file.
- A bus is full. Each bus holds at most 50 queries.
Related
- Screen: Modbus, Import and export queries
- Guide: Add a Modbus sensor