Page 19 - HTN_MarApr23
P. 19

will notice the Hello World_LED OTE turning OFF or displayed as black. Congratulations, you have run a simulation event for the Hello World LD program! The project’s final step is to upload the LD program to the Arduino Uno PLC.
Uploading and Testing the Hello World LD Program on the
 Figure 13. Selection and Configuration of the Power Rails
The final step of building the LD program is connecting the XIC and OTE bit instructions. With the mouse, click the right end of the HelloWorld_PB XIC bit and drag it to create a line. Continue dragging the line to connect to the left side of the HelloWorld_LED OTE bit. This line creates a rung to manage the XIC and OTE bit instructions control logic operation. The completed LD program is shown in Figure 14.
Arduino Uno PLC
Click the Stop Sign to turn off the simulation event. You will reset the LD program by clicking a small box next to the HelloWorld LD program name located on the left side of the editor with the mouse. Click the Arduino Uno icon in the taskbar to select the correct USB communication (COM) port and the appropriate microcontroller development platform. Figure 17 shows the configuration panel for the selected COM port and the Arduino Uno board.
Figure 17. Configuration Panel
You may find the correct COM port using your PLC development machine’s Device Manager. With the Arduino Uno board and the COM port selected, click the Upload button. After the runtime tool has converted the ST program to C-code then to a binary file and uploaded it to the Arduino Uno, a “Done” message will be displayed in the compilation output window. Figure 17 illustrates the Hello World LD program uploaded to the Arduino Uno PLC. Press the PB1 tactile switch on the solderless breadboard prototype,
and the LED shall turn on. Releasing the tactile pushbutton switch will turn off the LED. Congratulations on building a low-cost PLC using Arduino Uno and the OpenPLC software! In the next article installment, you will learn how to implement OpenPLC using the Freenove Project’s kit board.
Dr. Don Wilcher,
an Electrical Engineer, Technical Education Researcher, Instructor, Maker, Embedded Systems-Mechatronics Lecturer, and Book Author. He is the Director of Manufacturing and Technology at Jefferson State Community College.
  Figure 14. The Hello World LD Program
Super job building the Hello World LD program. You will simulate the LD program to test the logic. Click the sunglasses next to the Config0.Res.instance0 dropdown box. After clicking the sunglasses, you will see the left rung attached to the HelloWorld_PB XIC bit instruction turn green. Green means the LD program is ready to be simulated. Figure 16 shows the LD program is ready to be simulated. Select the running man at the taskbar to run the LD program. The PLC Started text will be displayed in the PLC log section of the editor.
Figure 15. Starting an LD Simulation Event
Figure 16. Hello World LD is Ready for Simulation
To interact with the simulation, right-click with your mouse and select “Force True” from the presented selection list. The Hello World_LED OTE bit should turn green. Right-click with your mouse and select “Force True” from the selection list. You
      highTECH NEWS | MARCH/APRIL 2023 | 19
 Dr. Don Wilcher

   16   17   18   19   20