ControlLogix and PLC5 Messaging August 2004 |
Many of you have been asking about messaging between PLC-5 and ControlLogix processors. The procedure to set up this messaging depends on which processor is initiating the message instruction. Below I have posted examples of messaging over DH+. Disclaimer: Due to the wide variety of plant applications, this application may not work for everyone. Although I believe all this information to be accurate, it is your responsibility to verify the information is correct, and modified to fit your own plant standards. Especially when damage to personnel or equipment can result.
This example will assume the following (modify the example for your particular application): Scenario 1) PLC-5 Initiated Read The PLC-5 will be reading 10 elements from the ControlLogix system. Therefore, in the PLC-5, we must have a place to store the 10 elements we receive, and a control file for the message instruction to operate. To create these files you must be offline or in program mode. Right click on the 'data files' folder, and create a new file. The first file is 10, and will be an integer type consisting of at least 10 elements. When finished press OK. Next right click on Data Files again and create another new data file. This example uses file #11, the type is message, and will contain one element. Press OK. Now look in your project tree. Under the data file folder you should now have an N10 file, and an MG11 file. Write the PLC5 Logic. You will have an XIO instruction with the address MG11:0/EN, and a message instruction with the Control file MG11:0. Within the MSG instruction, you can click Setup Screen to access configuration information for the message instruction. You will see two frames. One frame for 'This PLC' (The PLC-5 configuration), and another frame for the target processor. For 'This PLC', the communication command will be a PLC-5 typed read. The data table address for this example is N10:0. The size is 10 elements, and the port number is 1A because channel 1A is being used for communication to the ControlLogix. The 'Target Device' is the ControlLogix processor (This is where data is coming from). Since the PLC-5 doesn't understand the ControlLogix tag naming conventions, this message will have to come from a PLC-5 type address. For this example, we will pick N15:0. The target node is the node number of the 1756-DHRIO module (76), and the network type is local. Now the message instruction is configured to go out channel 1A and connect to the ControlLogix chassis. Then it takes ten elements from what it believes to be N15:0 to N15:9, and store the data in N10:0 to N10:9 in local memory.
There are two more issues to deal with: The next issue is that there is no memory location configured in the ControlLogix processor for the PLC-5 to connect to. Since the Tag structure of controllogix is different than the tag structure of the PLC-5, we have to set up an array, and then map all requests for file15 to this array. (since the PLC-5 is looking for N15:0) Create a tag called OUTBOX, and the data type will be INT[10]. Next click the Logic tab (offline), and choose Map SLC/PLC messages. Map file 15 to the OUTOX array. Populate the OUTBOX with data, and then look at file 10 in the PLC-5. You should see your data updating. Scenario 2) ControlLogix initiated read For this example the ControlLogix will read ten elements from N12 in the PLC-5, and store this data into a ten element array called INBOX. First, the INBOX must be created. Right click on Controller tags, and add a new tag called INBOX with the data type of INT[10]. The type is INT because the PLC-5 does not support DINT data types. Next, add a new rung to an executable routine consisting of an XIO followed by an MSG instruction. For this example, the control word for the message instruction is MSGCONTROL. Since this is an undefined tag, you must then right click the tag and select new 'MSGCONTROL'. The data type should have defaulted to message. Address the xio as MSGCONTROL.EN. Click the elipsis (3 dots) within the MSG block to access the configuration screen. The source element is N12:0 with a size of 10 elements. The destination element is INBOX. Now click the communication tab at the top of the dialog box. Since this is a DH+ message, we need to configure the path to get to the DHRIO module, and then the Data Highway Plus configuration will take it from there. For the path enter 1,4. From the processor's point of view, we need to specify 1 which is the ID for the backplane, and then 4 (slot number of DHRIO module). In communication method frame, choose DH+. The message will go through Channel A on the DHRIO module to node 16 on the Data Highway. (This is the node number of the PLC-5). Leave the Link Ids at default since this is a local network. Next, in the PLC-5 project, right click the data files folder and add data file 12. The type will be integer with ten elements. Populate this table with data. Download and test your work
Good Luck, and Best Regards to All!!!! |
||