08.05.2018, 19:41 (This post was last modified: 08.05.2018, 20:11 by sx3.)
Hello,
I'm trying to make a JSON mapper for the Schneider APC UPS ove Modbus TCP but I'm having some problems.
No values get present, and the error is:read failed: Illegal data address
Does RTU read test work for these register addresses? Also there's no point in using float16, you will get precision loss when converting from uint16 to float16 for larger values.
08.05.2018, 20:19 (This post was last modified: 08.05.2018, 20:26 by sx3.)
Actually I found my mistake, I was looking at an old documentation when mappin. Things have changed alot with the one linked in OP. Tried the new registers in OP documentation and it seem to work.
So I should just delete bus_datatype column?
How about dividing a value with 256 or 64? is there a mapper object for that?
I have problems reading and writing to bool-registers that in the documentation have stated "Length # register" = 2.
Does this have anything to do with why I'm not able to read out from theese?
To read two registers at once set "datatype" to "uint32". At this moment writing to registers with bitmasks is not supported, you have to calculate final register value via a script.
10.05.2018, 07:22 (This post was last modified: 10.05.2018, 07:24 by sx3.)
Thanks! uint32 worked for reading.
Now to the bigger problem, scripting. I searched the forums and found a similar thread regarding writing a bit, but I'm not sure I understand it? I have edited it to suit me.
Must I first set mode, before I send either of the bool KNX telegrams? This register contains 32 bits, no need store all the other bits?
But I'm not convinced I have done it right, valuue+512=512+512 and so on?
How will the Bool KNX objects be resetted to 0? Otherwise they will be 1 next time the script runs and perhaps set the UPS in ByPass by error?
10.05.2018, 08:08 (This post was last modified: 10.05.2018, 08:34 by sx3.)
1-byte value comes from the example that you gave in another thread, that I tried to understand. I have no clue to be honest.
In this register there are 32 writable bits, some of them are reserved though. https://forum.logicmachine.net/showthrea...24#pid6824
Bit 4 (bypass) and bit 5 (out of bypass) are exclusive as they both control the state of the UPS. I can only write true to one of them because it toggles between thoose states, either bypass or online.
Am I in the ball park with this script? Setting bit 4 in 1536 to true.
I tried it, but it doesn't seem, to work.. I have log(value) in the end, and the value shows up in the log.
I tried with both value=0 and 1, no difference.
I get nothing in the error log either.
Where in the code do I actually settrue/false to the register bit? I guess the UPS would want a "true" in BOOL for the bit to react.
Also, do I need to setslave in TCP script as I have done?