Hello everyone! Welcome to channel 'Factonation' Today, let's discuss on the foundation of MODBUS RS485 Let's start with the question "Why should we learn how to use MODBUS RS485?" I believe that a lot of viewers here already have the foundation knowledge of PLC or other kinds of sensors but I also believe that a lot people are seeking to learn more about how to communicate using a standard language For example, in the factory, we may use several different brands of PLCs so when we need PLCs of different brands to communicate, we will need a standard language which is MODBUS RS485 to build a 'Device Agnostic' system which means the devices are not tied to a particular brand In addition, MODBUS RS485 is the prerequisite for MODBUS TCP/IP which is MODBUS variant used to communicate over TCP/IP networks; can be LAN or WIFI instead of 2 electrical wires In this example, I will use the brand AMSAMOTION Actually, what you will learn from this VDO series is not limited to this particular brand You can apply the basics to the different PLC brands as well However, there are definitely different practices when you use different brands like the configuration method, memory location, which we will discuss further later on But as mentioned earlier, the particular example, I will use 2 AMSAMOTION PLCs Before jumping into the content, I would like to start with the demonstration I will use the most frequent used commands of MODBUS to demonstrate which are these commands shown in the presentation. Starting with 'Read Coil' command it simply commands the PLC to read the coil. We can set coil as either 'Y' or 'M' The next command is 'Read Input Status'. In the brand like Mitsubishi or Amsamotion, the input is set as 'X' Next, the 'Read Holding Registers' is to read the value 'D' which is not the 1-bit value anymore, but it's the 16-bit value index Next command is the 'Force Single Coil' command which writes single coil to be either ON or OFF in the slave or we can also use this command to set the 'D' value of another PLC now let's start the demonstration
On my screen, the Master's screen will be on the left while the Slave's screen will be on the right Please do not be alarmed by the pre-written code on the screen as it is for the demonstration purpose only First, I will start by monitoring the master PLC and let's look into each section together These 3 lines here is the read coil command which is to see if the output coil of the slave PLC is ON or Off And here you can see that the value is 0 in the data register D0 which means that none of the outputs are ON Now I will go on and set one 'Y' to ON and let's see the change in D0 value Now I will plug the communication cable into the slave PLC Now I will turn on one of the auxiliary relays so that Y0 will be ON Now let's move back to our master PLC Now that we set the slave's Y0 to ON, the D0 value on the master side is now changed to 1 I will explain later on on how to apply this function Let's continue with the second function which is 'Read Input' Now I have connected the input into our X0. We can see that our master can also read that D1's value is 1 Now I will remove the input of X0 by manually remove the cable we will see that once X0 is no longer ON, the D1's value will change from 1 to 0 which means that none of the bit is ON This is just to demonstrate that we can also 'read input' from the slave PLC The third command is the 'Read Holding Registers' which is to read a WORD value on the slave PLC In this case, on the slave's code, I have moved the K22 to D500 which means that the D500 on the slave now store the value of 22 Now I command the master PLC to read the value on the address D500 on slave PLC and store that value on master's D2 You will see that the value on master's site is now 22 as well. Hence, if we alter the value on slave's site, the value on the master's site will be changed accordingly The forth command is 'Force Single Coil' which is to write a single coil Y to ON In this demonstration, I will write Y1's value to ON from master's station Now I will broadcast the command... So the command is to tell the master to force the slave to write Y1 to ON and now Y1 is changed to ON I can also write Y1 to OFF by broadcasting the OFF coil command... You will see that it is also possible to write Y1 to OFF as well For the last command is to write the data register value In this case, I will send out the value '555' to the slave's address D501 Now I stop monitoring the master's station and move the communication cable to the slave's PLC To check the command, I will go to device's memory to see the value in address D501. You will see that the value in D501 now is set to 555 which was written by the master PLC So that was all the demonstration. My objective is to show you all the contents which will be included in this VDO series. And I will walk you through from the very basic like unboxing to configuration, writing commands, explaining the command components and so on. This VDO now comes to an end. Please kindly subscribe our channel and see you in the next VDO :) Sawasdee krub!