Partners: Technology
|
Horner Electric Automation Application Examples
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
^ Top of Page ^ |
Data-Linc Radio Modem Configuration: | ||||
It is necessary to make sure the Radio Modems are configured for Modbus communications, as well as making sure the baud rate and other communications settings are the same as for the OCS. Both Radio Modems will need to be configured. To configure the Radio Modem, connect the Computer COM port to the Radio Modem 9-pin port using the Straight-Through 9-pin cable and connect power to the modem through its adapter. You should see the red P LED light up. On the Computer, a dumb terminal program, such as Term.exe or HyperTerminal in Win95/Win98, should be run. Configure it to talk at 19,200 Baud, 8 Data bits, No parity, 1 stop bit, and No Handshaking. Once this is accomplished, you will need to put the Radio Modem into Configuration mode. Do this by inserting a paper clip into the small hole in the back panel of the Radio Modem and pressing the button inside. The Radio Modems Main Menu should appear on the terminal program. Press 0 for Set Operation Mode. One Radio Modem should be set to Point to Point Master, the other to Point to Point Remote. It makes no difference whether the Radio Modem set to Master is connected to the OCS acting as Modbus Master or to the OCS acting as Modbus Remote. This setting is completely separate from anything relating to Modbus. Once this is set, press Esc to exit back to the Main Menu. Next, press 1 for Set Baud Rate. Select one of the baud rates that will match the baud rate you set for the OCS in the Open Port Function Block. For this test, both 9600 Baud and 57.6 KBaud worked fine. (115.2 KBaud pushes the OCS limits too far and errors occurred regularly.) This setting only affects the rate of transfer between the OCS and the Radio Modem. Communications between the Radio Modems is fixed at 144 KBaud. After selecting a baud rate, the "Data, Parity" (option A) should be set to 0. This corresponds to a setting of 8 Data bits, No parity, and 1 Stop bit. After setting the Data and Parity, the Modbus RTU (option B) should be set to 1. This enables the Radio Modem to transmit the Modbus protocol. Once these options are set, press Esc to exit back to the Main Menu. Next, press 3 for Edit Radio Transmission Characteristics. The first option within this menu is the FreqKey. This setting MUST be the same on both Radio Modems. Valid values are from 0 to E (hex, of course). The value can be changed if interference is suspected or if communications seem slower than normal, but it must be changed in both Radio Modems. Options 1, 2, 3, and 4 should not be changed! Option 5 sets the transmission power of the Radio Modem. Valid values are from 1 to 9. The higher the number, the further apart the Radio Modems can be placed. Within a building and within 100 feet of each other, a setting of 3 should be sufficient. A setting of 9 may enable the Radio Modems to be placed as far as 20 miles apart, though conditions would have to be nearly perfect and the proper antennae would have to be used. Options 6, 7, and 8 should not be changed! Once these options are set, press Esc to exit back to the Main Menu. Press Esc from the Main Menu to ready the Radio Modem for communications. ^ Top of Page ^ |
||||
OCS Configuration: | ||||
For this particular test, an OCS, with no I/O cards installed, was used as the Modbus Master. Another OCS, with no I/O cards installed, was used as the Remote. Which OCS units are used and what I/O cards, if any, are used makes no difference. Remote The program written and downloaded to the Modbus Remote OCS for this demonstration is shown in Appendix A of the printed document. It is simple, as the Remote does not do anything except to open the port for Modbus communications, as a Modbus Remote, and wait for the Master to tell it what to do. In this program, the Function Keys are set to Momentary mode. The port is opened by pressing F1, thereby triggering the N.O. %K02 contact on and opening the OCS port for Modbus communications. Once the port is opened, the Modbus Remote Function Block is executed, specifying the OCS port 1 as Modbus Remote ID 1. The timeout is set to 25/10ths of a second, or 2.5 seconds. The Status Register is set to %R1001. When the F2 key is pressed, %K02 is triggered on and the N.O. %K02 contact passes power to the Close Port Function Block. The only other function this ladder program executes is a bit rotator, which rotates the 16 bits from %I01 to %I16 every 0.7 seconds. These registers are what the Master reads in this demonstration. Screen 1 of the OCS can contain a binary data field showing registers %Q01-16, which are written to by the Master. There can also be a text field showing whether or not the RS-232 port is open (for Modbus communications) or closed (able to talk to CScape programming software) by monitoring %T01 for this particular program. Master The program written and downloaded to the Modbus Master OCS for this demonstration is shown in Appendix B of the printed document. The Function Key mode should be set to Momentary. The basic operation of the program is to first initialize the Message Control Block (MCB) registers with the first MCBs values. When the user presses F1, the port is opened for Modbus Communications. The port is defined as a Modbus Master with a timeout of 25/10ths of a second, or 2.5 seconds. The Status Register is set for %R1001. The rest of the program does an assortment of things. There are two MCBs for this demonstration. The first MCB writes the contents of the Master OCSs registers %I01 through %I16 to the Remote OCSs registers %Q01 through %Q16. The second MCB reads the Remote OCSs registers %I01 through %I16 and places those values in the Master OCSs registers %Q1 through %Q16. Upon power up, the first MCB is loaded into the MCB Register. When the Status Register returns a 1, meaning the command was successful, the second MCB is loaded into the MCB Register and told to execute. The Status Register is also zeroed. When the Status Register returns a 1 again, the first MCB is again loaded into the MCB Register and told to execute. This continues to cycle until a fault is reported (Status Register returns something higher than 1). Upon seeing a value of anything higher than 1 in the Status Register, Screen 5 is triggered which displays the Status Register in Binary format, which can then be compared to the status register bit definitions in the CScape help file to determine what the fault was. To clear the fault and close the port, F2 is pressed. To restart the port, F1 is pressed again. Screen 1 can be configured to show %Q01 - %Q16, in binary format. There can also be a text field showing whether or not the RS-232 port is open (for Modbus communications) or closed (able to talk to CScape programming software) by monitoring %M02 for this particular program. |
||||
Download (139K print quality pdf file) the complete seven page document, Data-Linc & OCS Modbus Application Notes, with Appendices. |
^ Top of Page ^ | ||
|
||
Products |
Features & Benefits | Focus Item | Product Selection Guides | Catalog | PDF Library | Order Information | FAQ | |
Tech Resources |
Engineering Specifications | Articles & Technical Papers | Installation Information | |
Partners |
GE Fanuc | Omron | Rockwell Automation | Schneider Electric | Siemens | Technology Partners | |
Industries |
Security | and other industry application notes and diagrams | |
Sales Channels |
Distributors | System Integrators | OEMs | |
News |
Tradeshows and Events | Press Releases | Newsletters | |
About Us |
Overview | Jobs/Employment | Office Locations/Contact Information | |
ChineseEspañol | ||
|
||
© 1996-2009 Data-Linc Group. All rights reserved. |
100629
|