-
-
czj2008szdf | 当前状态:在线
总积分:722 2024年可用积分:0
注册时间: 2008-07-04
最后登录时间: 2019-07-13
-
intouch 与AB PLC 如何通讯啊 ?
czj2008szdf 发表于 2009/6/18 8:44:24 8256 查看 5 回复 [上一主题] [下一主题]
手机阅读
-
-
-
winterswimer | 当前状态:在线
总积分:2907 2024年可用积分:8
注册时间: 2006-08-30
最后登录时间: 2015-10-30
-
winterswimer 发表于 2009/5/7 14:05:56
AB PLC的通讯协议一般有DF1(开放)、DH+(不公开)、ABTCP等!
只要InTouch有相关的驱动,就可以直接和AB PLC通讯。DF1协议Intouch肯定支持,其他请咨询intouch技术支持。
也可以通过RS Linx的OPC功能通讯。
引用 winterswimer 2009/5/7 14:05:56 发表于2楼的内容
-
-
-
-
czj2008szdf | 当前状态:在线
总积分:722 2024年可用积分:0
注册时间: 2008-07-04
最后登录时间: 2019-07-13
-
czj2008szdf 发表于 2009/5/7 16:19:04
引用 czj2008szdf 2009/5/7 16:19:04 发表于3楼的内容
-
-
-
-
winterswimer | 当前状态:在线
总积分:2907 2024年可用积分:8
注册时间: 2006-08-30
最后登录时间: 2015-10-30
-
winterswimer 发表于 2009/5/14 15:23:07
Rslinx自身提供OPC和DDE服务,读取AB控制器的寄存器,并通过OPC或DDE服务转发。我们在测试前,首先,需要设置RSlinx需要连接AB PLC,然后,对OPC和DDE服务进行设置,主要是Topic的设置,最后,就可以通过第三方OPC Client软件测试了。
注意:很多人机界面软件支持OPC功能,即能提供OPC server功能,也能做OPC Client,比如HMIBuilder、MCGS、KingView等。
下面是摘自NI的例子,仅供参考!
Using RSLinx OPC Server
Overview
The National Instruments Industrial Automation Servers CD has an Allen Bradley (RSLinx) driver that can communicate with RSLinx through a dynamic link library (DLL). With the release of Industrial Automation Server CD 1.1, this server became an OPC server. Any OPC client, such as Lookout, BridgeVIEW, or other packages on the market, can connect to this server. Rockwell Automation developed their own OPC Server in version 2.0 of RSLinx. This version has been upgraded to version 2.20.
Rockwell Automation RSLinx 2.10 is an OPC server, meaning that any OPC Client should be able to exchange data with this server. The OPC server is available only with the OEM version or the full version, so the lite version of RSLinx does not have the OPC Server included. RSLinx OPC server is an in-process type of server, which means that you have to load a DLL to communicate with it. RSLinx 2.0 to 2.20 OPC servers only support the browsing capability on Control Logix 5000 series PLCs. Other Allen Bradley PLCs can be used on the OPC server by manually adding the addresses to be seen.
Another mechanism of communication between applications and RSLinx is through the DDE server that comes with RSLinx. The DDE server is only available for Rockwell Automation DDE clients in the OEM version. The drawback of DDE connection is that it is slower than OPC. If you decide to use the LabVIEW DDE VIs, then you need to have the full version of RSLinx.
This document was created using RSLinx 2.20.01.107.01, Allen Bradley MicroLogix 1500 PLC, ServerExplorer 2.4.1, Lookout 4.5 and the LabVIEW DSC module 6.0.2.. The cable model number used was 1761-CBL-PM02.
Table of Contents
Configuring an Allen Bradley PLC in RSLinx
1. Start RS Linx and click on Communications>>Configure Drivers.
2. The Configure Drivers dialog box appears. Click on the Available Driver Types pull-down menu and choose your communication driver from the list. For instance, if you have the regular serial connection, choose RS-232 DF1 devices from the list.
3. Click Add New.
4. Enter any name you want for the driver name in the Add New RSLinx Driver dialog box. Click OK when you are done.
5. Configure the device. Click the Auto-Configure button and RSLinx will auto-configure the device for you. If the auto-configure failed, contact Allen Bradley technical support for help. Click Help if you need more information about device configuration. Click OK to go to the next step.
6. Now you should be able to see the driver that you just created in the Configured Drivers section of the Configure Drivers dialog box. Make sure there is no error showing and that the Status indicates Running. Click Close.
Now you should be able to see your device when browsing the tree.
7. If you do not see your PLC in the list, uncheck the Autobrowse checkbox and click Refresh. When you highlight the items in the window, you should see the little squares in the communication icon blinking, meaning that there is a communication link between the PC and the PLC.
8. Right-click your PLC icon and click Configure New DDE/OPC Topic.
9. A new access path is added for your server, so when you define the access path in your SCADA software, you have to use the following syntax: [Access Path]Item. You can enter any name you want for the access path. In this example the access path is ML1500.
10. Click Done after you are finished, and click Yes when RS Linx prompts you to update the topic.
Now you should be able to access all the available registers on your PLC from any OPC client software. With the access path ML1500, the syntax to access the register N7:0 would be [ML1500]N7:0. Next, test the OPC server just created using RS OPC Test Client.
10. Launch the OPC Test Client from Start>>Programs>>Rockwell Software>>OPC Tools>>OPC Test Client. Then select File>>New.
11. Select RSLinx OPC Server and click OK.
12. At this point you should see a blank screen called OPC Test Client – [~RSLinx OPC Server]. Select Group>>Add Group.
13. Enter anything for the group name.
14. Click OK. Now you should be able to see the group in the previous window.
15. Select Item>>Add Item.
16. For the access path, enter the topic name you defined previously and type the register name you are trying to get data from or writing to. Click the Add Item button and the item name should appear in the left-most field, as shown in the illustration. Add all the items you want, and click OK when you are done.
You should see the items and value that you just connect to under ItemID.Connecting ServerExplorer to RSLinx
1. Launch the Industrial Automation Server Explorer 1.1 (or higher). Right-click on RSLinx OPC Server and choose Wizard.
2. It is important to choose the In-proc Server (DLL). RSLinx does not support a Local Server. Click Next to connect to the server.
3. Define the group name and the update rate. Click Next then Finish at the next screen.
4. At this point you should be able to see the green traffic light meaning that ServerExplorer has successfully connected to the OPC server. Create an item by right-clicking on the group name that you just created, then click Add/Edit Items.
5. The Name (Device\Item) can be any string. The Item ID should be in the [Access Path]Item format. In this example it should be [ML1500]O0:0. Then click Add.
Note: If you are using RSLinx 2.20.01 or a later version/build and a Control Logix 5000 Series PLC, you should be able to browse and select the registers. However, for all other Allen Bradley PLCs, RSLinx OPC Server does not support browsing, and you will have to manually enter the Device Name and Item ID.
6. Validate all items.
7. Click OK, and you should be able to see register data in ServerExplorer.Connecting Lookout to RSLinx
Lookout can connect to the RSLinx OPC server through the OPCClient object. This document assumes that you know Lookout. If you do not have any previous experience with Lookout, then we strongly recommend you to go through the introductory material in the Lookout documentation.
Note: Lookout currently does not have drivers for the Allen Bradley Control Logix PLCs.
1. First, create a new OPC Client object. Choose Object>>Create>>OPC Client.
2. Choose the RSLinx OPC Server. The server is an In-Process Server (DLL), so make sure that you choose this server type. The browsing method can be either Disabled or Flat. Make the default access path equal to the topic name that you defined in RSLinx. Click OK and open the Object Explorer.
3. Drag and drop the OPCClient1 onto your front panel. The Insert Expression dialog box should appear.
4. Complete the expression by typing the item you are trying to read from the server, for instance, OPCClient1.O0:0. Notice that there is a dot between the tag name and the item name.
You can also type the access path by adding the ‘item name’.‘~access path’. Some servers use the access path, so you can type explicitly, if you want.
Another method is to select Edit Database and type the item name in the Member field. Add an alias, but do not use a colon or a dot. In this case, the Object Explorer will have your alias available, so you can drag that and drop it onto your control panel.
NOTE: Lookout 3.8 users must define the access path in the description field of the database. Because RSLinx does not support browsing, you have to type the access path manually. The format for that is: ~~[Topic name]item. For the example above, use ~~[ML1500]O0:0. You should also change the Cache Update Rate to at least 2 ms, otherwise your CPU usage will approach 100%.Connecting LabVIEW to RSLinx
LabVIEW itself is not an OPC Client, but it can be used to communicate to OPC Servers through the DataSocket VIs. DataSockets have an OPC layer, allowing you to read and write to an OPC Server from LabVIEW (or LabWindows/CVI).
DataSocket is a technology based on TCP/IP composed of two elements: the DataSocket API and the DataSocket server. The API provides an interface for different data types, converting the data into a stream of bytes that can be sent across a network via TCP/IP. To learn more about DataSocket, visit National Instruments web page at www.ni.com/pdf/wp/wp1680.pdf.
The following is a brief example of how to connect to RSLinx OPC Server from LabVIEW using our example VI.
1. Launch LabVIEW and open opc.llb in the ...\National Instruments\LabVIEW 6\examples\comm folder.
2. Open NI Demo OPC Client.vi.
3. This VI can connect to any OPC Server using DataSocket connection. Next, connect it to RSLinx OPC Server. Set the Server Name to be RSLinx OPC Server, and the Item Name in the form [Access Path]Item. In this example we are trying to connect to register O0:0 using access path ML1500 defined in RSLinx, therefore the item name would be [ML1500]O0:0.
4. Click the run button when you are ready.
You should see the register data that you just connected to.Connecting the LabVIEW DSC Module to RSLinx
1. Launch LabVIEW and open the Tag Configuration Editor by selecting Tools>>Datalogging & Supervisory Contol>>Configure Tags.
2. Click the Create Tag icon and select Analog Tag. When the Analog Tag Configuration dialog box appears, enter the Tag Name as shown.
3. Click the Connection tab, choose the Tag Access Type, Server Name (RSLinx OPC Server in this case), and click the Create button under I/O Group.
4. Type in the Group Name and enter the Update Rate and the Deadband, and click OK.
5. Click the Add button in the Analog Tag Configuration dialog box, and enter the Item Name and Access Path.
You can either create new tags by clicking the Create Next Tag button in the Analog Tag Configuration window, or click OK to go back to the main window where you should see the items you just created. Save the scf file.
6. Create a new VI; go to Tools>>Datalogging and Supervisory Control>>Monitor Tags. Make sure the Tag Engine is also launched in order to monitor tags.
7. Within the Tag Monitor, you can choose the created tags under your computer name, and monitor the data obtained from the PLC. Now, you should be able to write your own LabVIEW code using the tags from you scf file.Reader Comments | Submit a comment ?
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
引用 winterswimer 2009/5/14 15:23:07 发表于4楼的内容
-
-
-
-
winterswimer | 当前状态:在线
总积分:2907 2024年可用积分:8
注册时间: 2006-08-30
最后登录时间: 2015-10-30
-
winterswimer 发表于 2009/5/15 0:08:32
- Configuring an Allen Bradley PLC in RSLinx
- Connecting ServerExplorer to RSLinx
- Connecting Lookout to RSLinx
- Connecting LabVIEW to RSLinx
- Connecting the LabVIEW DSC Module to RSLinx
Configuring an Allen Bradley PLC in RSLinx
1. Start RS Linx and click on Communications>>Configure Drivers.
2. The Configure Drivers dialog box appears. Click on the Available Driver Types pull-down menu and choose your communication driver from the list. For instance, if you have the regular serial connection, choose RS-232 DF1 devices from the list.
3. Click Add New.
4. Enter any name you want for the driver name in the Add New RSLinx Driver dialog box. Click OK when you are done.
5. Configure the device. Click the Auto-Configure button and RSLinx will auto-configure the device for you. If the auto-configure failed, contact Allen Bradley technical support for help. Click Help if you need more information about device configuration. Click OK to go to the next step.
6. Now you should be able to see the driver that you just created in the Configured Drivers section of the Configure Drivers dialog box. Make sure there is no error showing and that the Status indicates Running. Click Close.
Now you should be able to see your device when browsing the tree.
7. If you do not see your PLC in the list, uncheck the Autobrowse checkbox and click Refresh. When you highlight the items in the window, you should see the little squares in the communication icon blinking, meaning that there is a communication link between the PC and the PLC.
8. Right-click your PLC icon and click Configure New DDE/OPC Topic.
9. A new access path is added for your server, so when you define the access path in your SCADA software, you have to use the following syntax: [Access Path]Item. You can enter any name you want for the access path. In this example the access path is ML1500.
10. Click Done after you are finished, and click Yes when RS Linx prompts you to update the topic.
Now you should be able to access all the available registers on your PLC from any OPC client software. With the access path ML1500, the syntax to access the register N7:0 would be [ML1500]N7:0. Next, test the OPC server just created using RS OPC Test Client.
10. Launch the OPC Test Client from Start>>Programs>>Rockwell Software>>OPC Tools>>OPC Test Client. Then select File>>New.
11. Select RSLinx OPC Server and click OK.
12. At this point you should see a blank screen called OPC Test Client – [~RSLinx OPC Server]. Select Group>>Add Group.
13. Enter anything for the group name.
14. Click OK. Now you should be able to see the group in the previous window.
15. Select Item>>Add Item.
16. For the access path, enter the topic name you defined previously and type the register name you are trying to get data from or writing to. Click the Add Item button and the item name should appear in the left-most field, as shown in the illustration. Add all the items you want, and click OK when you are done.
You should see the items and value that you just connect to under ItemID.Connecting ServerExplorer to RSLinx
1. Launch the Industrial Automation Server Explorer 1.1 (or higher). Right-click on RSLinx OPC Server and choose Wizard.
2. It is important to choose the In-proc Server (DLL). RSLinx does not support a Local Server. Click Next to connect to the server.
3. Define the group name and the update rate. Click Next then Finish at the next screen.
4. At this point you should be able to see the green traffic light meaning that ServerExplorer has successfully connected to the OPC server. Create an item by right-clicking on the group name that you just created, then click Add/Edit Items.
5. The Name (Device\Item) can be any string. The Item ID should be in the [Access Path]Item format. In this example it should be [ML1500]O0:0. Then click Add.
Note: If you are using RSLinx 2.20.01 or a later version/build and a Control Logix 5000 Series PLC, you should be able to browse and select the registers. However, for all other Allen Bradley PLCs, RSLinx OPC Server does not support browsing, and you will have to manually enter the Device Name and Item ID.
6. Validate all items.
7. Click OK, and you should be able to see register data in ServerExplorer.Connecting Lookout to RSLinx
Lookout can connect to the RSLinx OPC server through the OPCClient object. This document assumes that you know Lookout. If you do not have any previous experience with Lookout, then we strongly recommend you to go through the introductory material in the Lookout documentation.
Note: Lookout currently does not have drivers for the Allen Bradley Control Logix PLCs.
1. First, create a new OPC Client object. Choose Object>>Create>>OPC Client.
2. Choose the RSLinx OPC Server. The server is an In-Process Server (DLL), so make sure that you choose this server type. The browsing method can be either Disabled or Flat. Make the default access path equal to the topic name that you defined in RSLinx. Click OK and open the Object Explorer.
3. Drag and drop the OPCClient1 onto your front panel. The Insert Expression dialog box should appear.
4. Complete the expression by typing the item you are trying to read from the server, for instance, OPCClient1.O0:0. Notice that there is a dot between the tag name and the item name.
You can also type the access path by adding the ‘item name’.‘~access path’. Some servers use the access path, so you can type explicitly, if you want.
Another method is to select Edit Database and type the item name in the Member field. Add an alias, but do not use a colon or a dot. In this case, the Object Explorer will have your alias available, so you can drag that and drop it onto your control panel.
NOTE: Lookout 3.8 users must define the access path in the description field of the database. Because RSLinx does not support browsing, you have to type the access path manually. The format for that is: ~~[Topic name]item. For the example above, use ~~[ML1500]O0:0. You should also change the Cache Update Rate to at least 2 ms, otherwise your CPU usage will approach 100%.Connecting LabVIEW to RSLinx
LabVIEW itself is not an OPC Client, but it can be used to communicate to OPC Servers through the DataSocket VIs. DataSockets have an OPC layer, allowing you to read and write to an OPC Server from LabVIEW (or LabWindows/CVI).
DataSocket is a technology based on TCP/IP composed of two elements: the DataSocket API and the DataSocket server. The API provides an interface for different data types, converting the data into a stream of bytes that can be sent across a network via TCP/IP. To learn more about DataSocket, visit National Instruments web page at www.ni.com/pdf/wp/wp1680.pdf.
The following is a brief example of how to connect to RSLinx OPC Server from LabVIEW using our example VI.
1. Launch LabVIEW and open opc.llb in the ...\National Instruments\LabVIEW 6\examples\comm folder.
2. Open NI Demo OPC Client.vi.
3. This VI can connect to any OPC Server using DataSocket connection. Next, connect it to RSLinx OPC Server. Set the Server Name to be RSLinx OPC Server, and the Item Name in the form [Access Path]Item. In this example we are trying to connect to register O0:0 using access path ML1500 defined in RSLinx, therefore the item name would be [ML1500]O0:0.
4. Click the run button when you are ready.
You should see the register data that you just connected to.Connecting the LabVIEW DSC Module to RSLinx
1. Launch LabVIEW and open the Tag Configuration Editor by selecting Tools>>Datalogging & Supervisory Contol>>Configure Tags.
2. Click the Create Tag icon and select Analog Tag. When the Analog Tag Configuration dialog box appears, enter the Tag Name as shown.
3. Click the Connection tab, choose the Tag Access Type, Server Name (RSLinx OPC Server in this case), and click the Create button under I/O Group.
4. Type in the Group Name and enter the Update Rate and the Deadband, and click OK.
5. Click the Add button in the Analog Tag Configuration dialog box, and enter the Item Name and Access Path.
You can either create new tags by clicking the Create Next Tag button in the Analog Tag Configuration window, or click OK to go back to the main window where you should see the items you just created. Save the scf file.
6. Create a new VI; go to Tools>>Datalogging and Supervisory Control>>Monitor Tags. Make sure the Tag Engine is also launched in order to monitor tags.
7. Within the Tag Monitor, you can choose the created tags under your computer name, and monitor the data obtained from the PLC. Now, you should be able to write your own LabVIEW code using the tags from you scf file.
引用 winterswimer 2009/5/15 0:08:32 发表于5楼的内容
-
-
-
-
czj2008szdf | 当前状态:在线
总积分:722 2024年可用积分:0
注册时间: 2008-07-04
最后登录时间: 2019-07-13
-
czj2008szdf 发表于 2009/6/18 8:44:24
引用 czj2008szdf 2009/6/18 8:44:24 发表于6楼的内容
-