Step 1: To follow below diagram for connecting all electric wires between PLC, electric devices and sensors Installation of Temperature Sensor connected with Temperature Module of Mitsubishi PLC
Step 2: To follow below diagram for connecting electric wires of temperature sensor with Mitsubishi Temperature module
Step 3.1: Start MELSOFT GX Works application software, then go to tool bar and select “Engineering” (“工程”) as well as select “Open” (“打开”),
Step 3.2: choose Smart-Patch_Project_LED_Motion_sensor.gx3
Step 4: In the PLC program, go to toolbar and select “Monitor (write mode)”
Step 5: Start XAMPP database application by double clicking icon “ ” for launching Web Server of “Apache” and online SQL Database shown as below
Step 6.1: Open any Browser and then key in “Localhost:8080/phpmyadmin/” on domain name bar, you will see the following screen about PhPmyadmin panel
Step 6.2: select “Browse” to see database records shown as follow
Step 7: Next, take your Smart-Patch device and switch it on by supplying it power, and then wait for Windows 10 OS being started up after 10 to 15 minutes; afterwards, typing “cmd” and select “Run as administrator” to open “Command Line Program”
Step 8: On the command line program, type “node-red” and wait for the message of node-red program to show “Loading palette nodes” after around 10 minutes.
Step 9: Click on any browser and key in “localhost:1880” on domain name bar for launching Nod-Red Program
Step 9.1: After launching “IMPORT” function, go to bottom of the window and select “new flow”; then go to upper side of the window for clicking on “select a file to import”.
Step 9.2: Select files of (WashingMachine_Final_Version)Flows.json, (WashingMachine_final_Version)Flows2.json, Smart-Home(Final_Version)flows.json one by one to import them into the Node-red program
Step 10: Go to upper-right-hand-side of the program and select symbol “ ” for choosing IMPORT function.
Step 10.1: You will see the following those node-red flows (“流程”) of (WashingMachine_Final_Version)Flows.json, (WashingMachine_final_Version)Flows2.json, Smart-Home(Final_Version)flows.json one by one; then, select “流程2” , you will see Blue box in which there boxes are mentioning “WRITE_X0_1_FX5U_192.168.1.234:502, this mentions connection between node-red program and the PLC with IP address of Mitsubishi PLC. Just move the blue box forward by moving mouse to highlight the blue box and moving it forward, you will see right-hand upper corner of the symbol of “Deploy” that will be switched to Red colour. Just double click on “Deploy” for launching updating the connection bewteen Mitsubishi PLC and “流程2” of Node-red program. So do the same action on flow 2 for launching connection between Mitsubishi PLC and Smart-Home flow as well.
Step 10.2: You will see that there is green signal under each blue box to show “connected” for PLC and connected in term of “OK” for Database shown as follows
Step 11.1: Washing Machine dashboard and Smart-Home dashboard can be shown by typing “localhost:1880/ui” on domain name bar of the browser; if want to see Smart-Home dashboard webpage, you can click on the upper left-hand side icon “ “ to show all ui webpages and then select of Home Floor Plan shown below second diagram.
Step 11.2: After selecting the Node-red dashboard of HOME FLOOR PLAN shown as follows, you can see the blubs were turned on in term of yellow colour shown on the dashboard. When the blubs were turned off, the colour of those blubs are grey. The indoor temperature is as same as the temperature value shown on the dashboard of Washing Machine.
Step 12: Trouble Shooting. When you found out any problem of “connection lost” in between PLC, the simulation of monitor function of Mitsubishi GX Works software and Node-red dashboard software, you can turn off the Node-Red dashboard and start it again by following steps. Step 12.1: Click Command Line Window and press “Ctrl + C” button for stopping Nod-Red, then key in “Y”, then the Node-Red program will be turned off. Step 12.2: Plug out the power from the PLC and then power on it again after 1 minute; go back step 8, key in “node-red” on command line window again for starting Node-red program and follow step 9 to step 11 again.
(This fundamental tutorial about how to carry out data visualisation with Node-Red for PLC, it supposes that you have basic knowledge on installing Node.js, Node-Red, XMAPP database server and know how to code PLC ladder program at all first)