How can i quickly import of a recent added unit

So lets say i have 3 different unit models A,B and C running on modbus with address 1-3.
And say I have figured out all different tags for every unit, how would i save this for exporting and importing again if im adding more units by the same type?
Example:
How can i duplicate this if im adding 2 new units by model B and 1 model C and only change the address when adding? All tags should already be there except if its a new version

thanks

1 Like

Let’s suppose that you have a Modbus station B.StationA, under which are I/O tags (measured points) with names like M.StatA* (e.g. M.StatA_speed, M.StatA_power, etc).
The procedure would be like this:

  1. download rxfind tool (e.g. from RxFind - Regex Search and Replace Tool Download - SoftSea) which we will use for find/replace in XML files

  2. XML export station + all the points (select them, right-click, choose XML Export) to some directory (e.g. D:\temp\StationA), copy also rxfind.exe here

  3. remove UIDs from all XML files: run rxfind.exe in the directory StationA (from a command prompt)
    rxfind.exe *.xml /B:2 “/P:<uid>.*</uid>” “/R:”
    rxfind.exe *.xml /B:2 “/P:<uuid>.*</uuid>” “/R:”

  4. copy this directory to StationB

  5. rename the station and the files - run rxfind with appropriate arguments in StationB directory:
    rxfind.exe *.xml /B:2 “/P:B.StationA” “/R:B.StationB”
    rxfind.exe *.xml /B:2 “/P:M.StatA” “/R:M.StatB”
    (note: the file names will not be changed, only the contents of files)

  6. import the XML files from StationB directory via the Cnf tool (via menu Objects → XML Import)

repeat points 4-6 for StationC, D, etc.

Should you want to copy the station (e.g. StationD + points to a new line, e.g. L.NewLine, just edit XML file of StationD and change the <ParentId> item to a new line before import:
<ParentId>L.NewLine</ParentId>

Should you need, all this can be automated in D2000 and performed in a script (even without rxfind.exe and storing files to the disk) using XML manipulation functions - https://doc.ipesoft.com/label/D2DOCEN/as_funkcie_xml

For example, XML_ExportD2ObjToDocument performs export of D2000 object to an XML document in memory, and XML_ImportD2ObjFromDocument lets you import it back into D2000 (as a modified object or as a new object, depending on whether you modify its identifiers (Id, Name, uuid)

Hello, :wave:

To manage and duplicate your Modbus unit configurations, you can follow these steps:

  • Start by exporting the current configuration of your units, including their tags and addresses. This will give you a template to work from.

  • Create a copy of this exported configuration. Update the addresses in the copied file to reflect the new units. You can usually find this in the configuration file or database where you store the Modbus settings.

  • Import the modified configuration file back into your system. This will add the new units with their respective addresses but keep all the tags and settings from the original units.

  • Check if the new units are correctly configured. If there are any new versions or tags, update them accordingly.

I hope this will help you!

Thanks!

Hi,

By creating a configuration template, you need to define a JSON, CSV, or XML file for each model (A, B, C), containing all the tags and their respective settings. Include the Modbus address as a parameter.

Thanks :slightly_smiling_face: