Difference between DDE commands and Control Properties

chakorules

Member
Join Date
Apr 2002
Location
Huntington, IN
Posts
194
I am trying to write a VB app using DDE commands to get some values out of an AB PLC, but it's not working. The example I am trying to follow is located here:

http://domino.automation.rockwell.c...0E5D45B3B0B3567385256AFB0052D112?OpenDocument

Which give me the indication that VB or MS Access supports DDE Commands. But when I try and run a Sub routine in my VB app using the same "close to the same" example as above, I get an error.

I found this document here:

http://domino.automation.rockwell.c...935BFA8EE46CB59185256AFB00537BE7?OpenDocument

It says that I must use Control Properties in my VB, or turn off something in MS Excel yada yada yada.

Can someone tell me for sure if I can use the DDE commands in VB 6.0 if I enable a reference or something I am overlooking? Or maybe I HAVE TO use Control Properties in VB 6.0?

For reference:

DDE commands are:
DDEInitiate, DDERequest, DDE Terminate

Control Properties are:
Link Topic, Link Item, and Link Mode

Thanks.
 
First of all you must have a DDE Server to get the data to/from the plc and your VB application or Excel or Access. The most common DDE server would be RSLinx for A-B products.You more than likely have RSLinx Lite and that won't cut it. You must have RSLinx Gateway or RSLinx Single Node to perform DDE transactions. RSLinx Gateway is pretty expensive and RSLinx Single Node is around $350 if I remember right. Once you get a DDE server you need to set up a topic in the DDE server (RSLinx). Then in your VB application use a textbox or label control and set it's linktopic property to "RSLinx|{the name of your DDE topic}". Then set the linkitem property to the file number and element you would like to read/write to. You then set the linkmode property and do the linkpoke method of the control (textbox or label control).
 
I've got RS Linx full version. I know about all that stuff already thank goodness.

From what you are saying:

Then in your VB application use a textbox or label control and set it's linktopic property to "RSLinx|{the name of your DDE topic}". Then set the linkitem property to the file number and element you would like to read/write to. You then set the linkmode property and do the linkpoke method of the control (textbox or label control).

You are referencing Control Properties (Link Topic, Link Item, and Link Mode) that must be used in VB.

But have you EVER used DDE Commands in VB?

DDEInitiate, DDERequest, DDE Terminate?

If you have, what reference in VB did you enable to get DDE Commands to work?
 
Hello again, sorry for underestimating your understanding of controls and DDE usage. I used controls such as the textbox and label for DDE transactions but I was just like you in that I did not like the overhead of having to use controls. That is when I decided to look into the OPC side of things. I did a couple of searches on how to use RSLinx as an OPC server and found some examples. Not only did I lose the overhead but my transaction speed increased significantly.
To test the speed issue I had written a program in VB that would call an API to find the X,Y position of the joystick that was hooked into the gameport on my pc, I then used this information to flash different outputs faster or slower depending on the direction and how far the joystick was being pushed away from center. With DDE there was a significant lag between the time I moved the joystick and noticed my outputs starting to flash, but when I tried it with OPC the PLC's outputs flashed almost immediately after I moved the joystick. Hope this helps and I also hope I am not underestimating your knowledge of OPC.
 
zman,

I did not mean that at all. I am sorry if you thought. I was just saying it like. "Check!, I got that working already".

I did some reasearch on what you already proved and found an OPC whitepaper you might be interested in:

http://www.software.rockwell.com/do...oolkit/performance and throughput of opc.html

As far as my problem. craigsimon figured it out for me.

I did not know that the DDE commands are an EXCEL Object only. I needed to enable the Excel Object Library in Visual Basic to be able to use the DDE Commands in Visual Basic, otherwise you have to use Control Properties. However, I am going to look into using OPC after reading this whitepaper from AB. Thanks for helping! And Thanks craigsimon for pointing out the solution to my original question.
 
OPC vs DDE

If you decide to use OPC be advised that it is quite a bit more
complicated than DDE. Now that we have OPC 2.0 it is easier but
not easy. OPC's as well as AB's manuals
are full of mistakes, omissions and poor explanations (1.0 was just awful!). AB is trying to milk this one
by selling an SDK kit. You will have to spend days experimenting,
before you can actually get something accomplished.
There are third party vendors selling OPC client apps, which might help you some.
If you come up with specific problems just post it here and maybe I
or someone else can help you.
Good luck with this one!
 
Jiri,

You are not joking. I just got off the phone with my local AB rep. I've got to purchase SDK to use VB as a client OPC app. A whopping $2500 smackers...milking it isn't the word I would use.

I'd be better off purchasing RS View 32 Run Time $1000-$800 since I already have RS View Editor and going that route if I was going to stick with an AB product. Geez...

Still looking at different OPC third party on the net some of those are as much as RS View Run Time however. Thanks for additional advise and feedback. I'll post back if I find something interesting.
 
You are not joking. I just got off the phone with my local AB rep. I've got to purchase SDK to use VB as a client OPC app. A whopping $2500 smackers...milking it isn't the word I would use.

Not true, my little joystick program simply used RSLinx Gateway or for less money RSLinx Single Node, it IS a true OPC Server, you just have to reference the dll in your VB application.

I agree with the documentation hell but with a little trial and error you can get it to work.
 
OPC Servers

I Have used InGear's AB-OPC Drivers in VB 6 and was very happy with both the speed and setup time. The price was around $800.00 and you can use the drivers all your projects with out more charges.
 
zman,

Looks like my AB rep is trying to pull the covers down over my eyelids. I did a little bit more digging in the KB at AB.com. Guess what I found?

http://domino.automation.rockwell.c...C17C04B988A2AC3985256AFB005845ED?OpenDocument

This KB tech note shows an example of RS Linx and VB. I don't need SDK like my AB Rep said I did. I haven't been able to get this demo to work yet, but I'll keep playing. It keeps bailing out at this statment:

'Object reference to RSLinx OPC interface
Private MyOPCServer As RSLinxOPCAutomation.OPCServer
'Object reference to an OPCGroup (with events)
Private WithEvents MyOPCGroup As RSLinxOPCAutomation.OPCGroup

"User Defined error"

I have a reference enabled to Rockwell Software OPC Automation, but it still doesn't appear to want to run.

So in short of this thread I learned:

1. You can use DDE commands in your VB 6.0 project from Excel VBA if you enable a reference in VB 6.0 to Excel Library. (thanks to craig)

2. You can use OPC in VB 6.0 with RS Linx Full or Single Node and DON't need RS Linx SDK. (thanks to Zman)


Larry,

I am going to play with this OPC since I found a demo tech note on AB's website. But thanks for the link!
 
Love this Forum

You know I have gotten more help from this forum than you can imagine.

This is the first time I have really gotten a chance to help someone else and IT FEELS REALLY GOOD!!!

About the OPC Problem I think If I remember right you need to use the SET statement somewhere when referencing to OPC components, it's been a while so maybe I will get back into my joystick program when I get a chance.
 
Select correct DLL

I seem to remember a problem with referencing the wrong DLL and there was a document which talked about this. The DLL's in question were similar in name but one would not work for me and after doing a search I found the problem that I was referencing the wrong DLL, which the AB demo referenced to. Hope this helps.
 
Zman,

What you are referring to I believe is what the TECH Doc above states. Here is a snip:

For RSLinx 2.10 and 2.20 the OPC Automation interface filename is RSLinxOPCAuto.dll
For RSLinx 2.30 and later the OPC Automation interface filename is RsiOpcAuto.dll

Right now I have RS Linx 2.31 so I've done that, changed the DLL reference. Any other ideas you can think of?

Here is a screen shot:

screenshot.jpg
 
OPC

Chako,
You have not even began to scratch the surface and you already are running into problems.

'Object reference to RSLinx OPC interface
Private MyOPCServer As RSLinxOPCAutomation.OPCServer
'Object reference to an OPCGroup (with events)
Private WithEvents MyOPCGroup As RSLinxOPCAutomation.OPCGroup

The above was true for OPC 1.0.
In OPC 2.0 you need to do it as

Private MyOPCServer As OPCServer
Private WithEvents MyOPCGroup As OPCGroup

This is just one of many errors you will encounter.

Zman is trivializing the difficulties of implementation of OPC.
In order for you to create a multi screen application in VB
that will be bullet-proof and function with all error checking and
quality of data checking, you will have to do lots of ground work.
You will not only have the learning curve but you will also
have to create a bunch of Subs/Functions that will enable you
to manipulate the data and read/write the data to the PLC.
Once you have done your first application the second time around it
will be much easier, obviously.
But it's the first time around that will be a challenge.
Be prepared to burn some time on this.
If it was so easy why do you think that AB and others would create all these OPC client programs and sell it for big bucks?
My opinion is that the sooner we get to XML (SOAP) and forget about OPC the better.

In all fairness though I do acknowledge that if properly implemented
OPC does work reliably and fast.
 

Similar Topics

hi friends, Can any one explain me what is the difference between OPC server & DDE server in communication between PLC & SCADA. For my new...
Replies
6
Views
3,767
what is the difference between DDE and OPC, some people say than opc is the evolution of dde but i dont understanding wich is better or the...
Replies
1
Views
4,479
Can anyone explain the difference between DDE,ActiveX and OPC briefly?
Replies
1
Views
2,919
Hello, I have a problem with AO- and AA-Tags. When I use for example the tag AO_Test with the address 200 and type the value 1,2 in, the AA-Tag...
Replies
7
Views
1,361
As per the title. This might seem like a basic question to many, but I'm unclear about the difference between a coil ( ) and an application...
Replies
28
Views
3,880
Back
Top Bottom