Cookies are not enabled on your browser.
To learn more: https://www.automationdirect.com/ls-electric-plc?utm_source=7CkkqfZei1E&utm_medium=VideoTeamDescription
(VID-XG-0122)
LS XGB Help File Video: LP217-3
XG5000 V4.77 2024-06-28
To view the LS XGB Help File please visit: https://cdn.automationdirect.com/static/helpfiles/ls_plc/Content/Home.htm
**Please check our website for our most up-to-date product pricing and availability.
Related AutomationDirect.com Part Numbers: N/A
Previously, we used the “Addressing for Comm Devices” software to establish the addressing for our BSSRT input and output information. In this video, we will manually create a Modbus/TCP connection in our Do-more Designer software using the data addressing we generated. We will also establish the connection between a BRX PLC and the BSSRT, allowing the BRX to control the remote IO using Modbus registers. Specifically, we will try and control output points of our TN32A output module. We have Do-more Designer version 2.10.1 open. The software gives us the option to connect to a PLC, open an existing project from a few different sources, or start a new offline project. We will start a new offline project. Our PLC today is the BRX BX-DM1E-18ED13, so we will select that and click “OK.” The software creates a new project, and we will go to the “Project Browser” on the left side of the screen. If we right-click on “Configuration” and then select “System Configuration,” the “System Configuration” pop-up window appears. For our application,, we want the BRX to act as a Modbus Master controlling the BSSRT, and we want the information to automatically refresh in the background. Do-more Designer has a very nice function for this called “Modbus I/O Scanner.” We can select that option from the “Configuration Entries” list and then enable the Modbus I/O Scanner Service. We can add a blank device and we will name this device “@BSSRT.” Our PLC has a Pluggable Option Module with an Ethernet port installed, so in the Modbus Client field we can select if we want to use the DM1E’s on-board Ethernet port, or the POM port. Our network is connected to the on-board Ethernet port, so we will stick with @IntModTCPClient. The unit ID is the same as the slave ID for the BSSRT. If this was a Modbus/RTU serial connection, this number would matter, but for the Modbus/TCP, we will leave it at the broadcast address of 255. If we were connecting to a Modbus TCP to RTU gateway, this number would also become more important. The IP Address of our BSSRT is 192.168.27.120, and we set that in our previous video on BSSRT Remote I/O Setup. We will leave the port value at the default, and we can change the read and write intervals if we want to. Read and write intervals are determined by a balance of your I/O response needs and your available network throughput. If this number is larger, the lag between I/O changing and the information being seen by the master, in our case the PLC, will increase, potentially leading to poor system response. If it is smaller, the system response will be much faster, but the additional messages will increase the load on the network. If this gets too fast, the network can drop packets or even shut down altogether, depending on the networking hardware. For our read and write times, we will leave it at the default of 100 milliseconds. We are now ready to add some communication information for this Modbus connection. We will select “Add Comm,” and Do-more Designer adds a communication block for us. To figure out our Modbus registers, we need to go to our data addressing software tool. We set this up in the previous video on BSSRT Data Addressing, so please refer to it for further details. When we pull it up, we see that for our setup, the TN32A output module that we want to control is in slot 2, and the data will be at a Modbus Write Address of 0x40202. For Modbus, 0x4 will be a holding register, which is able to be read from or written to. We want to write to our output, and so we will target hex register number 202. Do-more Designer uses decimal-based addressing that starts at 1, not Hex addressing that starts at 0, like the BSSRT. We therefore need to convert 0x202 to decimal and then add one. If we go to our Windows calculator, we can go to the settings and select the “Programmer” option. This tool allows fast conversion from Hex to Decimal. We will select Hex and type in 202. The calculator tells us that the decimal equivalent is 514, and we add one, so we want to write to a Modbus offset register of 40515. If we go back to Do-more Designer, we can select function code 16 Write Multiple Registers, and our offset address is 515. The software also asks us the total count of registers we want to write to. To find this out, we go back to our BSSRT Data Addressing tool and take a look at the output size column. In our case, for the TN32A, it shows the output size as 2 words. If we wanted to write to several output cards or a combination of input and output cards, we might have to add some of these numbers together to get the total count. In our case, we just want the one card, so it will be just a total count of 2 words. We go back to Do-more Designer and enter a 2 into the “Count” field. We see that the software tells us it will be writing to registers 40515 and 40516. Perfect! Now we need to map this Modbus Write to an internal PLC memory variable. To do this, we will select “Add Field.” This brings up the Field box on the right side of the window, and we can name our field “BSSRT Slot 2 Write.” The Buffer word offset allows us to assign a variable to one of the later registers in a multiple register read or write. In our case, we are only reading two registers, and they are both getting assigned to a single 32-bit word. We will therefore leave this offset at 0. If we were writing to two TN32As with a single message, we could alter the count in the communication block to 4 16-bit registers, and then use this offset field set to a 0 for the first 32-bit variable, and an offset of 2 to assign the second 32-bit variable. Byte swap and word swap will be dependent on how the master and slave both arrange their information. In the case of the BRX controlling the BSSRT, we won’t use either. Your specific situation may vary, so you may have to try a few combinations of these settings to get all of the output points to be assigned to the correct bit in your PLC variable. For our copy section, we will leave it as a Raw copy since the information is being stored by the BSSRT as 32 bits of raw data and not a signed or unsigned integer. If we were reading information from or writing information to one of the more complicated modules, such as an analog module, for instance, we might want to do a Single Field conversion for a specific data format, such as signed 16-bit integer. Our local address defaults to N0, which is a signed 16-bit register. We are handling 32 bits of raw information, so we would do better to use a 32-bit register. If we double-click in the “Local Address” field, it will open the Element Picker, and we can see that 32-bit signed registers will be D addresses. We can maximize the various levels until we can select D100. Why don’t we use D0, you ask? Often when programming in Do-more Designer, the system will grab the first register of a variable type, such as N, C, or D, for function block memory, communication setting storage, etc. It’s best to be careful about manual variable assignment. Using a higher register ensures we don’t accidentally “step on” a variable already being written to by another PLC function. If this was a large project, it might even be best to start manual variable assignment at D1000 just to be safe. Now that we have assigned our internal PLC variable mapping for this case, we can then click “OK” The software will ask us if we want to regenerate our Device Profile for this Modbus Scanner Device. This is a nice little feature of Do-more Designer that lets you save your profile to your hard drive in case you need the same profile again in the future. It saves a lot of setup time if you are making multiple copies of the same thing or have multiple BSSRTs on a single network. In our case, we will just select “No.” We can quickly verify our BSSRT address, and it is correct, so we will now click “OK.” To connect this project with our BRX PLC, we will select “New Online.” The software asks us if we want to create a new online project or connect this project to a PLC. We want to connect the project to our PLC, so we will select that option. It then does a scan of our network for Do-more PLCs, and it finds ours at the IP Address of 192.168.27.20. It is the only BRX PLC found, so we know it’s the correct one. We could do a Blink & Refresh test as well if we wanted to be sure, as this will cause some of the LEDs on the front of the PLC to flash, identifying it for us. In our case, we don’t need to, so we will just click “Connect.” The software then tells me that the project in the PLC is different than the one we have created. We want to keep the offline project active rather than reading the project from the PLC, so we will select “Go Online and view the DISK project.” Finally, the software warns us again about the potential issues that can arise from having different projects in the PC software and the PLC connected to each other. Since we will be writing over the PLC in just a second, so that both the PC and PLC match, this is not a problem. We can select “Continue Online” for now. Let’s write this project to the PLC. It then asks us if we want to turn “ALL STATUS ON?” With this feature enabled, the software will update the variables as they appear in the ladder, not just in the data view. In our particular case, this won’t matter, since we have no ladder; however, it never hurts to have it on, so we will select “Yes.” Now, let’s open data view and add D100 so we can monitor and control it in the BRX PLC. We will also enable edit mode in the data view to allow us to change the value in D100, which should cause the BRX PLC to then write that value to the BSSRT TN32A module. Let’s also verify the health of our Modbus connection. For the Modbus I/O scanner in Do-more Designer, there is a really cool tool called the “Modbus Scanner Monitor.” We go to “Debug>Modbus Scanner Monitor” and the software opens the monitor in a pop-up window. We can see that our connection is active, and the transfer count is counting up, showing that our message is working. Perfect! In most circumstances, we will likely have an error count and a message in the “last error” field as well. This does not necessarily mean we have an active error. It just means that at some point, there was an error in the connection, and we registered this reason for it. If we do have an error, we can select “Clear All Status Fields” to reset it and see if the error recurs. In our case, we are error-free. You could access each one of these structure variables in the data view as well if you wanted. I like this debug tool, however, as it puts everything I need in front of me simultaneously. Now, let’s try and turn on the first output of our digital output module in slot 2. If we go over to XG5000, and then to the I/O parameter screen, which is already open in our case, we see that the TN32A output card is in slot 2, which is the 3rd slot, and that the first output point is variable %QX0.2.0. We set this project up in our initial video on BSSRT setup. Please refer to it for further details. Let’s add that %QX0.2.0 output point to the monitor window so we can see when the BSSRT bus coupler turns it on and off. We will also go into monitor mode, and we see that the output point is currently off. We could also look at the LED indicator lights on the front of the TN32A module as well. We go back to Do-more Designer, and we write a 1 into the edit column for the D100. If we now send this edit to the PLC and go back over to XG5000, we can see that the BSSRT has been commanded to turn on the first output point of the TN32A card in slot 2. Back to Do-more Designer and we’ll write a 0 to D100…. And back to XG5000…. And the output point is back off. Perfect! Reading information would be nearly identical, but we would use a different Modbus function code, and we would use our Data Addressing tool to find the Modbus address of the information we wanted to read. We are now able to control our remote I/O with our BRX PLC by setting up a Modbus/TCP connection in Do-more Designer.
Safe &
Secure
Voted #1 mid-sized employer in Atlanta
Check out our
job openings