
adccommunitymod (AutomationDirect) asked a question.
Created Date: April 24,2003
Created By: Steven
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
Hi all, What I'm trying to do is get some PLC data into MS Excel via OLE/OPC. I am using DSDataServer, and I was using DDE to populate some Excel tables, but then I found out that there's a limit on how many data items DSDataServer can handle in Windows 98SE. Since I 've heard OLE/OPC is better and faster, I'm trying to figure out if and how I can use it to get data into Excel. I think there's a way this can be done, because Microsoft's help files mention it, buy I can't find out how anywhere. Excel will let you Paste Special- >Dynamic Link, and let you Insert- >Object- >From File. Supposedly these both use OLE to update the data. But what I'm trying to do is read PLC memory locations, like you can easily do with DDE, a la =DSData|Topic1!V2000 or by using the DDEPoke method. Some websites have suggested that this is possible through using ActiveX controls or other additional utilities. But I'd like to get the data using Excel only, through cell formulas or VB macros. Does anyone know how to do this, or even whether it can or can't be done? There seems to be a real lack of practical OLE/OPC info out there, so I'm hoping someone can help me. Any help or feedback would be appreciated. Thanks!
Created Date: April 25,2003
Created by: Mike McClanahan
If I can find it again at home I have an example of using VB macro code in excel to retrieve data from an OPC server. I think that I got it from the OPC Foundation Web site. I also found this link
http://www.opcfoundation.org/07_support/04_ask_opc/archives/1999.htm
If you search for excel on this page you will find the VB Macro code and several other suggestions on getting OPC code from Excel.
Hope this helps.
Mike
Created Date: April 25,2003
Created by: Steven
Thanks Mike, I really appreciate the help! I'm following leads at the OPC Foundation's site now, but their site navigation is confusing and it seems like they make their demo code available to members only.
If you have an example on how to access data from DSDataServer in Excel through OLE/OPC, I'd be very grateful! It seems like a simple thing to want to do... anyway, could you post it here or email it to me at snoto(at)impaxptg(dot)org? Thanks, I'll owe you one. http://forum1.automationdirect.com/board/smile.gif
Created Date: May 11,2003
Created by: Mike McClanahan
If you scroll down that link that I sent you to you will find a sample of using VBA code to move data from an OPC server into Excel using VBA code.
Mike
Created Date: June 03,2003
Created by: Mike McClanahan
For what it is worth (and assuming that you can get to it since I am on the wrong side of the firewall to test it) the code I have for using OPC in VB is on my FTP site at ftp://69.11.173.30.
I have included a readme.txt file that will help with getting started.
This program has been testing on W2K and WinXP. With a couple of minor modifications to control how it starts and stop the DSData program it will run on NT4.
If the FTP site kicks about wanting a username and password email me at usfokc@tds.net and I will set you up with an account.
Mike
Created Date: June 05,2003
Created by: cdobis
For those of us who don't have the time or will to do all of that programming, I thought I would tell you about a package that I have been evaluating. It is called DataWorx Server/Monitor. This simple looking software really is easy to set up and start recording your PLC data to a local disk or network drive. It works with AD PLCs and the E-com modules. The data can be saved as a comma or tab delimited file, that you can import into excel or notepad for that matter. Your PLC program determines the amount of data it records. They give you a really nice sample ladder program that works great. I think they still have an evaluation program available at their website for download: www.inteworx.net Hope this helps.
Craig http://forum1.automationdirect.com/board/smile.gif
(Link didn't work, so it was fixed...Admin)
Created Date: June 05,2003
Created by: Mike McClanahan
DataWorx looks like it may be a going project. Had some trouble with the installation at home that is caused by a bug in Microsoft Office 2000 (and maybe Office 97) installers but installed it here at work and have been playing with it. One major problem I have run into is that in the Configure PLC memory screen if you click the Auto Configure button it will write the data to the PLC. MAKE SURE THAT YOU DON't OVERWRITE EXISTING VARIABLE LOCATIONS IN THE PLC. Also the starting WX and RX memory locations MUST be prefixed with a capital V or it will write the data to the wrong location. Talked to the company and they are going to fix this and add a warning screen that you are about to write data to the PLC variable locations to give you a chance to chicken out.
It currently does not support bit mapping of a variable location to get binary data but they are going to look into something like the ADC method (V1400.1) to permit logging binary data.
Other than these items, it has been stable so far and looks good.
Mike
Created Date: April 24,2003
Created by: Steven
Hi all,
What I'm trying to do is get some PLC data into MS Excel via OLE/OPC. I am using DSDataServer, and I was using DDE to populate some Excel tables, but then I found out that there's a limit on how many data items DSDataServer can handle in Windows 98SE. Since I 've heard OLE/OPC is better and faster, I'm trying to figure out if and how I can use it to get data into Excel.
I think there's a way this can be done, because Microsoft's help files mention it, buy I can't find out how anywhere. Excel will let you Paste Special->Dynamic Link, and let you Insert->Object->From File. Supposedly these both use OLE to update the data. But what I'm trying to do is read PLC memory locations, like you can easily do with DDE, a la =DSData|Topic1!V2000 or by using the DDEPoke method.
Some websites have suggested that this is possible through using ActiveX controls or other additional utilities. But I'd like to get the data using Excel only, through cell formulas or VB macros. Does anyone know how to do this, or even whether it can or can't be done? There seems to be a real lack of practical OLE/OPC info out there, so I'm hoping someone can help me. Any help or feedback would be appreciated. Thanks!