Since OpenPLC does not have native support for the WL-MIO hardware a Modbus TCP gateway will be used. OpenPLC applications will interact with this gateway via Modbus to read and write I/O points. To install the gateway see the Application Note WL-MIO-AN-30200
1. OpenPLC IDE
2. WL-MIO system with a VPE-6040 Analog Input Module with ID 2 and a VPE-6030 Relay Output Module with ID 3.
3. Raspberry Pi with OpenPLC runtime installed and running.
4. Modbus TCP gateway installed and running.
Login to the OpenPLC runtime running on the Rasbperry Pi.
Go to the “Slave Devices” page.
Add a new device and configure to match the screenshot.
Add a new device and configure to match the screenshot.
The result should look like this.
Go to “Settings” and change the “Modbus Server Port” to something other than 502 to prevent conflicts with the Modbus TCP gateway.
Download the rpitest.zip sample project and extract it somewhere.
Start the OpenPLC IDE and open the sample project.
Click “Generate program for OpenPLC Runtime”. It is the orange down arrow in the toolbar.
Save the generated file and upload it to the runtime through the web interface. This can be done by clicking on “Programs” on the left side.
Once the program is loaded click “Start PLC” on the left side.
Apply more than 2.5V to the first channel of the VPE-6040 module with id 2 and the first relay should turn on.