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.

setup modbus tcp slave
#21
You can use HTTP(s) / remote services. Using BACnet for this has no advantages.

Option 1: Create an event script mapped to a certain tag that will send values via grp.update call on other LM. This way no polling is needed.

Options 2: Use polling by requesting exported object list from another LM. Go through that list and use grp.checkupdate to update local values. This might save some resources if very frequent update is not needed.
Reply
#22
Hello,
I try to use the script:
https://forum.logicmachine.net/showthread.php?tid=181
but not everytime I can connect with HL.
If I need canghe the modbus mapping start with 100 how I must modify the script.
Thank you
Reply
#23
Make sure that the client connections are closed properly. There's a limit on active connections to modbus TCP slave.

Mapping will always start from 0. You can specify mapping like this (+1 is need because Lua table start from 1, modbus addressing starts from 0):
Code:
registers = {}
registers[ 100 + 1 ] = '1/1/1' -- mb register 100
registers[ 101 + 1 ] = '1/1/2' -- mb register 101

Since mapping table will not be a continuous array, you will have to set mapping like this:
Code:
mb:setmapping(table.maxn(coils), 0, table.maxn(registers), 0)
Reply
#24
(07.05.2018, 11:30)admin Wrote: Make sure that the client connections are closed properly. There's a limit on active connections to modbus TCP slave.

Mapping will always start from 0. You can specify mapping like this (+1 is need because Lua table start from 1, modbus addressing starts from 0):
Code:
registers = {}
registers[ 100 + 1 ] = '1/1/1' -- mb register 100
registers[ 101 + 1 ] = '1/1/2' -- mb register 101

Since mapping table will not be a continuous array, you will have to set mapping like this:
Code:
mb:setmapping(table.maxn(coils), 0, table.maxn(registers), 0)

With this script it is possible manage  lux value (DPT 9.004) and counter value (DPT 12.001)? How I can do it?
Reply
#25
There's a work-around on how to implement float16<>float32 conversion:
https://forum.logicmachine.net/showthrea...833#pid833

Same goes for uint32 and similar values.

If you do not need to change these values from modbus side then you only need a single script per each value that will split 32 bits into two 16-bit values.
Reply
#26
I need convert in dt.int16 the datapoint lux value (DPT 9.004):
MEEEEMMM MMMMMMM
FloatValue = (0,01*M)*2(E)
E = [0 … 15]
M = [-2 048 … 2 047], two’s complement notation
For all Datapoint Types 9.xxx, the encoded value 7FFFh shall always be used to denote invalid data.
Reply


Forum Jump: