How To Duplicate Modbus Devices
-
Hello,
I have a device, an inverter, that has a bunch of data points.
I manually setup this device as a datasource "Inverter.1", and manually configured all of the data points for the correct modbus register / data type.
What I want to do is duplicate this datasource. I have 14 inverters. They are all identical, except that the ModBus slave id is incremented.
So the initial datasource is "Inverter.1" slave id "1".
So the second datasource is "Inverter.2" slave id "3".
So the third datasource is "Inverter.3" slave id "3".Etc.
How can I easily duplicate inverter 1 and add the rest of the inverters without manually setting up all of the modbus stuff 13 times?
I looked at exporting JSON configuration but I got confused (how / where do I generate new XIDs for the new datasources / datapoints?).
It seems like there must be a more simple way?
Let me know!
Thanks,
Alex -
There are a few ways to do this but we recently added the Administration > Bulk data point edit page which includes a csv download and upload. I updated this page and added a short video to demonstrate.
Basically, you would select the data source you want to duplicate and click the Download CSV button.
If it's Modbus IP then you will probably need to manually create the data sources as we haven't added a CSV upload for those yet. One way I would do it is I would export just the JSON for one data source. I would change the XID and host and import it and do this 14 times. I would use XIDs that make sense.
Then in my CSV I would change the action column to "CREATE" and clear out the XID and ID column. I would then change the Slave ID and the data source xid. If this is Modbus serial then you would have all the data points going into the same data source so you can skip that last step.
You could have all the 14 inverters in one csv file or import them one at a time. Save the CSV and then upload it on the Bulk data point edit page.
You can check out this page for more help: https://help.infiniteautomation.com/bulk-importing-data-points/
-
I looked at exporting JSON configuration but I got confused (how / where do I generate new XIDs for the new datasources / datapoints?).
XIDs can be omitted from JSON object in the import/export to get an automatically generated XID for the next point, and XIDs that are new as used as the XIDs for the new points created by the import.
-
Ok, this mostly worked.
If I add the new data source via json and leave id, Xid blank, that works fine.
When I try to add datapoints via bulk csv upload to the new datasource, there are columns in csv:
dataSourceId dataSourceXid
These columns need to be filled for the csv upload to work to create the datapoints on the new datasource.
However, for the freshly added datasource, I do not know what dataSourceId is.... I know the dataSourceXid (via json export of the datasource) but the only way I could find dataSourceId was to add a fake datapoint, and download the csv (bulk datapoint editor) to find the dataSourceId and the corresponding dataSourceXid.
A little clunky but it works... Saved me 14*24 manual modbus configs that is for sure!
Thoughts on how I could have done this more easily?
Thanks,
Alex -
Hi @mrlucretius
Glad you came right already. Once you get the hang of things you'll see that bulk configurations are actually very easy and super fast.
Once a data source is created with a blank XID. The generated XID can be found on where you edit the data source. Make sure that you are on the data source tab not the data point tabEdit:
@mrlucretius
I looked at exporting JSON configuration but I got confused (how / where do I generate new XIDs for the new datasources / datapoints?).The only real requirement with XID's is that they are unique to any other XID on the system. I use very descriptive XIDs for Data sources and watchlists. For Data points I use a traditional tagging system for my XIDs : AREA_SITE_EQIUIPMENT_NO. You are free to use what ever you are familiar with. My opinion is that you should be able to look at the XID and know what that point is at the lowest level. For larger DCS systems I would use the PLC_RACK_SLOT_NO convention.
The Operator of the SCADA will seldom see the XID of a point. -
The only real requirement with XID's is that they are unique to any other XID on the system
While true, there may be issues with certain characters in certain situations. It is best to avoid symbols in xids, for that reason: https://github.com/infiniteautomation/ma-core-public/issues/918