Connecting Bottle Filling Simulation with Arduino (Wokwi) via Modbus RTU communication
Here are the steps to make it:
1. Download the LabVIEW program in the following youtube video description:
• How to make a simulation of bottle filling...
2. Delete VISA Configure Serial Port, VISA Bytes at Port, VISA Read, VISA Write, and VISA Close, and the icons connected to them.
3. Add Create Master Instance, Read Holding Registers, Write Single Holding Register and Close.
4. In Create Master Instance:
Create Control at the VISA Resource Name pin .
Create Constant at the Unit ID pin , fill in the number 1.
Create Constant at the Serial Type pin , select RTU.
5. In Read Holding Registers:
Create Constant on the starting address pin , fill it with the number 0.
Create Constant on the number of holding registers, fill it with the number 1.
In the Register values pin , add an Index Array, fill the index with the number 0, and Create Indicator on the output Index Array. Name this indicator "input".
6. In the first Write Single Holding Register:
Create Constant on the address pin, fill it with the number 1.
Connect the shift register color data line with the holding register value pin . So that it doesn't start from 0, insert the Increment icon (+1).
7. In the second Write Single Holding Register:
Create Constant on the address pin , fill it with the number 2.
Connect the shift register enum data line with the holding register value pin .
8. So that Read Holding Registers is only executed once every 300 milliseconds, in the Case Structure Read Holding Registers, give the Case Selector (?) input with the value i (iteration) which is given the additional Quotient & Remainder function, with a divisor of 3, and the output at the remainder leg is given the Equal to 0 function.
9. In Case Structure Enum, replace all letters a,b,c,d,e,f,g,h sequentially with numbers 1,2,3,4,5,6,7,8, likewise for letters i and j outside Case Structure, replace with numbers 9 and 10.
10. Open Wokwi at the following link: https://wokwi.com/projects/4196418036...
11. Before running LabVIEW, select the paired COM Port (see Device Manager to find the paired COM Port). In the example here, COM5 and COM6 are selected. COM5 for LabVIEW and COM6 for Wokwi. Run LabVIEW and Wokwi. If the COM checkbox doesn't appear, press stop, then run it again.
12. By using the Modbus RTU Protocol, this simulation can be connected to the PLC, because in general, PLCs support Modbus RTU communication. As a tester, colleagues can use Modbus Slave. Set baudrate = 9600, 8 data bits, no parity, 1 stop bit. Open the Holding Register window (F = 03). Fill the first row (index 0) with numbers 1 to 10 and observe the results.
To make it easier, here is a download link for the LabVIEW program: https://drive.google.com/file/d/1uT_T...
For further information, please visit this blog: https://5menitbelajarlabview.blogspot...
Информация по комментариям в разработке