This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Modbus variables: import massive
#21
(03.05.2018, 06:40)Erwin van der Zwart Wrote: Hi,

You can use this script to map your modbus profiles to objects automatically.


PS: Make backup before you run it because there is a lot created (:

It creates 255 objects each run and skips already mapped objects, so you need to change to address scope and run it again for the next 255 objects. So for 1200 objects you need to run it 5 times.

BR,

Erwin

Hi Erwin,
further to your reply above, this procedure is valid for modbus RTU as well?

I have about 20 modbus fancoils and I would like to generate knx objects for each modbus device.

The example is:

Knx addresses 1/1/xx for modbus address device 1.

Knx addresses 1/2/xx for modbus address device 2.

How can do that? 

Thanks.
Reply
#22
It should work for both TCP and RTU. The mapping part is the same for both modes.
Reply
#23
(05.08.2019, 06:39)admin Wrote: It should work for both TCP and RTU. The mapping part is the same for both modes.

Thank you admin.

What I cannot understand about the script is where I declare the modbus address of the modbus device. 

I have 20 rtu modbus devices.

Thanks.

Claudio
Reply
#24
Then count amount of registers your device has then replace 255 with your register number. Then run this script once for each slave and change grp_address.
------------------------------
Ctrl+F5
Reply
#25
(05.08.2019, 07:16)Daniel. Wrote: Then count amount of registers your device has then replace 255 with your register number.  Then run this script once for each slave and change grp_address.

Hi Daniel,
so everything works fine. Except for some modbus variables which have been not linked to any knx address.
Please find enclosed what I mean. How can sort it out please?
Thanks.

Attached Files Thumbnail(s)
   
Reply
#26
Registry which are not mapped to object are ignored. This is by design as there is no point to pool something which you can't use in the system.
------------------------------
Ctrl+F5
Reply
#27
(05.08.2019, 11:28)Daniel. Wrote: Registry which are not mapped to object are ignored.  This is by design as there is no point to pool something which you can't use in the system.

Sorry Daniel,
but it is not clear. I mean that on json profile registry those variables are mapped as all others. But they have been left and not linked to any KNX address in the automatic mode starting the script.

Is strange or not?
Reply
#28
A sorry you referring to automatic mapping by script, too many threads Wink
To be honest I never used this script. I would need to see the profile.
------------------------------
Ctrl+F5
Reply
#29
This is caused by mismatch of bus_datatype and datatype fields.
Try changing this line:
Code:
datatype = mapping.bus_datatype or mapping.datatype,
Reply
#30
(05.08.2019, 11:44)admin Wrote: This is caused by mismatch of bus_datatype and datatype fields.
Try changing this line:
Code:
datatype = mapping.bus_datatype or mapping.datatype,

Great!!


Now it's working perfectly.

Thanks.
Reply


Forum Jump: