If you have an
ECOM100 module in your Do-more PLC system, and you wish to
programmatically configure its IP Settings (IP Address, Gateway Address, Subnet Mask), there is no
native instruction to do this.
However, the equivalent expanded IBox logic from DirectSOFT can easily be implemented in a Do-more!The attached project has a code-block called
ECSetupIP that utilizes stages to sequence through the necessary steps involved.
ECSetupIP Input Parameters:
- D100 contains the IP Address
- D101 contains the Gateway Address
- D102 contains the Subnet Mask
ECSetupIP Output Parameters:
- C100 Success Bit
- C101 Error Bit
- DLV42 Error Code (will be 0 on success; see the DirectLOGIC ECSETUP IBox documentation for error code information)
ECSetupIP Internal Variables:
- V100 - V143 as the Message Buffer
- @ECOM_000 device (tweak this for YOUR installation)
$Main has an X0 contact to drive a
RUN ECSetupIP box.
Just unzip the attached .ZIP file. It contains the ECSetupIPEmulation.dmd project file, which will work with any Designer version 1.3 or later.
EDIT: One caveat - if you need to change the DL42
Error Code output parameter address to a different DLV address, you also need to tweak the
To DL V42 parameter in the DLWX instruction at rung #4 to the corresponding DLV address (e.g. if you change all the DLV42's to DLV100, then you need to also change the
To DL parameter in the DLWX instruction to V100).
EDIT2: Second caveat - remember to turn ON dipswitch 7 in your ECOM100 module (NOT the CPU) to ENABLE IBOX functionality in that ECOM100.
As with all examples, this is for educational purposes only and the user assumes all responsibility for its use.