TCP/IP Data Source examples?
-
Hi Dan,
I think you need to start with the most basic scenario and work up from there.
Does the device respond to commands on RS232?Does the device respond to commands through the Moxa RS232 to TCP/IP converter? There must be some software out there that talks to this device that you can point at the Moxa. Might need to use the moxa virtual serial port which creates a COM port that redirects to the moxa device over RS232. I've done this on windows and linux before.
If the existing software for the device can communicate with it through TCP/IP converted to RS232, you can use wireshark to capture the TCP/ip conversation. Then you will have an idea of what you need to send from mango and what response you should get.
-
Thanks for the info, I'll give that a go and see how we get on.
Cheers
Dan -
Hi Dan,
If you're working on a Linux system, using "nc" can be very useful when you're playing with the TCP/IP Data Source. Point the data source as linuxhost:9000, run "sudo nc -l 9000" (-k to keep alive) and let the experiments begin!
-
ah yes, nc is a great idea. I'll try some tests with that.
Thanks heaps.Cheers
Dan -
the results are interesting...
when I enable the data source, I get an echo of the read command I put in the data point, which is good, however if I drill down on the data point and press the refresh button it doesn't re-send the packet to the TCP port. -
There are a number of data sources who haven't had their forcePointRead method implemented, so that little refresh arrow doesn't do anything. But, I've implemented it in the TCP/IP module, just for you! You can download it through the modules page.
Don't forget to:
sudo nc -l 9000 <<< 'Mango is awesome!'
-
oh! hahaha! you have no idea how many times I pressed the little refresh button then looked at the other monitor to see if something was happening.. that's hilarious!
Thanks for enabling that, I'll download it now.Cheers
Dan -
I'm supposed to send this to the controller for it to just report back a bunch of stuff..
AA 55 AA 55 AA 55 EB 90 EB 90 EB 90 16 A0 00 B1 A7 7F
Is there a data source log I can tail to see the transaction happening? And maybe somewhere to see the data that comes back so I can strip back what I need?
Cheers
Dan -
Logging can be enabled by adding the line
<category name="com.infiniteautomation.tcpip.rt"><level value="debug"/></category>
below similar lines in your Mango/classes/log4j.xml file, near the bottom, then either restarting Mango or, if you have log4j-reset installed, by going to your System Settings page in the log4j reset section and reloading the logging configuration. This will output into the normal Mango log file.
I'm going to put in a RollingIO log, like Modbus and Serial have, as well as a testing utility and hopefully release it this week. It would make it easier to use, for sure.
-
thanks for that I'll give it a go.