Help - Search - Members - Calendar
Full Version: Daily Data Gathering
Forums.MrPLC.com > PLCs and Supporting Devices > Allen Bradley
Thomas
I am trying to get about 30 elements of daily production data from 4 different plc5's to a spreadsheet on my desktop box. The setup is a desktop pc with excel (dde link) > rslinx >ethernet > 1756 enet > dh+ > plc's.

The problem is: once I start rslinx and the spreadsheet the polling is continuous leading to data dropouts (and unnecesary dh+ traffic).

How can I gather the data once per day, reliably, and minimize network load?
Chris Elston
Sounds like a DDE "Cold" Link would better suit you. I would write a VBA script in Excel to get your data via a timed event and COLD DDE calls.

Download this sample file, look at the VBA script code by viewing the Macro editor.

http://www.mrplc.com/dl/index.php?action=v...ntry&entryid=74

A cold DDE link looks like this:

CODE


       'opens a COLD DDE link
       RSIchan = DDEInitiate("RSLinx", "M1138")
                                                         
   
       'read word F8:10 and load into a VB variant variable
       f810data = DDERequest(RSIchan, "F8:10")
       'read word F8:11 and load into a VB variant variable
       f811data = DDERequest(RSIchan, "F8:11")
       'read word F8:12 and load into a VB variant variable
       f812data = DDERequest(RSIchan, "F8:12")
       'read word F8:16 and load into a VB variant variable
       f816data = DDERequest(RSIchan, "F8:16")
       'read word F8:18 and load into a VB variant variable
       f818data = DDERequest(RSIchan, "F8:18")
       'read word F8:17 and load into a VB variant variable
       f817data = DDERequest(RSIchan, "F8:17")
       'read word F8:20 force check #1 and load into a VB variant variable
       f820data = DDERequest(RSIchan, "F8:20")
       'read word F8:21 force check #2 and load into a VB variant variable
       f821data = DDERequest(RSIchan, "F8:21")
       'read word F8:22 force check #3 and load into a VB variant variable
       f822data = DDERequest(RSIchan, "F8:22")
       'read word F8:23 force check #4 and load into a VB variant variable
       f823data = DDERequest(RSIchan, "F8:23")
       'read word F8:24 max force and load into a VB variant variable
       f824data = DDERequest(RSIchan, "F8:24")
       'read word F8:25, get PASS or FAIL status from PLC and load into a VB variant variable
       varResults = DDERequest(RSIchan, "F8:25")
       
       'close COLD DDE link
       DDETerminate (RSIchan)
       
       'write all values to cells
       Cells(lngRow, 1).Value = f810data
       Cells(lngRow, 2).Value = f811data
       Cells(lngRow, 3).Value = f812data
       Cells(lngRow, 4).Value = f816data
       Cells(lngRow, 5).Value = f818data
       Cells(lngRow, 6).Value = f817data
       Cells(lngRow, 7).Value = f820data
       Cells(lngRow, 8).Value = f821data
       Cells(lngRow, 9).Value = f822data
       Cells(lngRow, 10).Value = f823data
       Cells(lngRow, 11).Value = f824data



Hope that helps.
Thomas
Thanks. I think I'll try that approach.
Over the weekend I kludged it by setting the polling in rslinx dde topic configuration to 1,000,000 ms. Ugly but it worked.

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.