CGI to get IO Setup on PLC Module

Michael McSharry

Active Member
The WebControl supports the I/O Setup page and presents a checkbox matrix of how invert status is setup on inputs and outputs, however this matrix is filled with javascript so the returned HTML cannot be scraped to get the I/O settings. What CGI commands should be used to get the invert/not-invert status of each of the discrete inputs and outputs?

The current status of end points on the WebControl can be obtained with status.xml and individual items can be found with CGI calls. What is documented in the manual does not include the method to obtain the I/O setup information.
 
Michael,

You are absolutely correct, the ipsetup.htm page is not handled by HTTP GET, but by HTTP POST call. The data is directly read or write to the EEPROM. If you want to handle that in your code, you will need to mimic the POST call in WebControl. In the WebControl, the http server callback function for reading this is function 0x00000044. You will need to handle login and cookie to be able to do that.

All the information in the status.xml are from HTTP GET calls. Some network parameters are also from POST calls.

Please let us know if we can be any help.

Happy Holidays!
 
I do not mind handling it in my code, but would like an API definiiton and an example. I only need the read capabilty because I can use the same approach as was used for BRE to set the invert status. Can you provide and example?
 
Basically, just do a Ajax push, with open set to "GET, iocfgdata, true). WebControl will reply with the HTML byte encoded data for the io configuration. The data is 34 bytes in the latest version, encoded into hext bytes total 68 bytes in reply. The sequence of the replies are: PLC_enabled, browser control, plc control, invert output, invert input, X10 enabled.
Since the communication is all clear text, you can actually see them if you installed Wireshark on PC and manually refresh that screen, you can capture all the detailed communication back and forth.
 
Back
Top