I'm a newbie to Mango, and am putting together a small implementation to get it talking to multiple remote machines for a power company here in New Zealand.
All these bits of equipment talk Modbus (TCP) and I've been having quite good success with several of them.
One thing that's giving me a bit of grief however is that one control unit I would like to talk to, and of course it's one of the more popular ones, requires a certain password is written to it before it allows modbus reads, and if there is no activity within 15 seconds then it terminates the connection.
So I have two issues.
- How to perform this particular write within Mango
- How to then monitor the communications and at startup or loss of coms send the password to re-initiate.
I guess the answer to 2) is to simply preface every message with the password? but then how do I get that working?
From the manual (Unit is a Comap IG-NTC-BB generator controller , information is at www.comap.cz if anyone is interested) the instructions are:
Modbus/TCP access code
Every Modbus/TCP session has to be started with writing the access code from the modbus/tcp client
to the controller. If the session is closed and reopened again the access code must be written again.
The session can be closed by the client or the controller closes the session automatically if there is no
activity from the client side for 15s.
- There are new dedicated registers for entering the AccessCode via Modbus/TCP.
- The register numbers are 46339-46346 (register address 6338-6345).
- The previous method using register address 24535 remains working as well. [*NB: I am still looking for documentation on this application as it may be easier to implement]
- Example of the Modbus message is following (in HEX):
01 10 18 C2 00 08 10 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FE F3
01 Controller address
10 Modbus function (16dec – Write multiple registers)
18C2 Register address (18C2hex = 6338dec = register 46339)
0008 Number of registers
10 Length of the data (Number of registers x 2B) [* not sure about this either, what is 2B and how does it relate to the registers?]
30000000... Access code string (16 chars, null-terminated, ASCII, here “0”) [*another mystery, what is the '3' for? if the password is '0' wouldn't all the characters be 0?]
Some devices do not support the modbus function 16. In this case can be the access code
writen in controller as one register No. 46339 using the function 6. The access code has to
be the number in the range 0 to 65535. [* This seems like a great idea but it seems Mango has only implemented functions 3 and 16]
Any assistance, advice or pointers in the right direction would be greatly appreciated.
My apologies if these are a little simplistic.