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.

TCP Modbus
#6
You can use in both, but first you need to figure out correct byte/word order by using this in your script:
Code:
v1 = mb:readregistervalue(128, 'float32', 'n')
v2 = mb:readregistervalue(128, 'float32', 'b')
v3 = mb:readregistervalue(128, 'float32', 'w')
v4 = mb:readregistervalue(128, 'float32', 'bw')
log(v1, v2, v3, v4)

One of the values in logs should be correct.
Reply


Messages In This Thread
TCP Modbus - by leondias - 21.03.2017, 14:08
RE: TCP Modbus - by admin - 21.03.2017, 14:34
RE: TCP Modbus - by leondias - 21.03.2017, 14:39
RE: TCP Modbus - by unaxboy - 29.11.2017, 12:44
RE: TCP Modbus - by admin - 21.03.2017, 14:42
RE: TCP Modbus - by leondias - 21.03.2017, 14:47
RE: TCP Modbus - by admin - 21.03.2017, 15:59
RE: TCP Modbus - by leondias - 22.03.2017, 07:38
RE: TCP Modbus - by unaxboy - 13.11.2017, 04:18
RE: TCP Modbus - by admin - 29.11.2017, 13:09
RE: TCP Modbus - by unaxboy - 29.11.2017, 13:32
RE: TCP Modbus - by admin - 29.11.2017, 13:35
RE: TCP Modbus - by unaxboy - 29.11.2017, 13:55
RE: TCP Modbus - by admin - 29.11.2017, 15:54
RE: TCP Modbus - by unaxboy - 29.11.2017, 16:47
RE: TCP Modbus - by admin - 29.11.2017, 17:15
RE: TCP Modbus - by unaxboy - 29.11.2017, 18:22
RE: TCP Modbus - by Igor68 - 17.12.2017, 10:22
RE: TCP Modbus - by admin - 18.12.2017, 08:09
RE: TCP Modbus - by SportMaster10 - 12.09.2019, 11:20
RE: TCP Modbus - by AlexLV - 02.07.2020, 08:10
RE: TCP Modbus - by Daniel - 02.07.2020, 08:28
RE: TCP Modbus - by AlexLV - 03.07.2020, 06:56
RE: TCP Modbus - by AlexLV - 03.07.2020, 19:30

Forum Jump: