Author Topic: Simple DDE Access to display values from (and possibly write to) a DDE device  (Read 2029 times)

rms

  • Newbie
  • *
  • Posts: 21
    • View Profile
I know that DDE is ancient and not used that often, but I need to display data that is only available though a DDE interface

Here's some text from the manual...

BASIC PARAMETER COMMUNICATION
Client applications communicate to the FlowDDE server by using DDE messages. Before messages can be exchanged, a
DDE link had to be made. A DDE link consists of three parts: the server, the topic and an item. For separation the
characters '|' and '!' may be used, so a DDE link in e.g. Microsoft Excel becomes Server|Topic!Item.
For standard instrument parameters and the FlowDDE server, these are:

it looks like my question got cut off - so here it is
How to I poll, access and display the DDE Data with advanced HMI

Thanks
Rich
« Last Edit: August 15, 2023, 10:10:34 AM by rms »

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
You can install excel in the PC that running AAHMI, make sure to get a legit copy from Microsoft.
then in AAHMI,
Code: [Select]
        Try
            oXL = New Excel.Application()               ' or New Excel.Application() or CreateObject("Excel.Application")
            oWb = oXL.Workbooks.Add(Type.Missing)       ' Get a new workbook.
            oXL.Visible = True
            oXL.WindowState = Excel.XlWindowState.xlMinimized
            oWs = oWb.Worksheets("Sheet1")
            oWs.Activate()
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

Next open a DDE conversation and DDE commands.
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

rms

  • Newbie
  • *
  • Posts: 21
    • View Profile
thanks backphi

I actually have excel reading some of the data from the device via DDE conversation now. It's pretty slow to update - like seconds - no sure why - though it would be "instant", maybe the device on the DDE side is polling too many registers. Not sure.  I think I may try another route which is to send ASCII string (RS232) requesting specific info and then reading back the responses from the device - it's non instant, but it's better than the DDE timing. Thanks 

rms

  • Newbie
  • *
  • Posts: 21
    • View Profile
Update
Got the DDE dating reading into excel fast now - like a few updates/sec for about 20 values, good enough for me. Back to your post above, why do I want to run excel in the background, when what I really want is to have Advanced HMI read (via DDE) the values directly from the device (application) that it (excel) is reading from now. Seems like reading to excel and then reading excel data with AAHMI adds a step. (Maybe I'm missing something)  if excel can read and update DDE values , I think there should be a way for AAHMI to do the same
So the question is...is there a piece of code or object or something that I can use or drop into AAHMI that will
1) display values from a DDE "address"
2) continuously "poll" that address and update display with latest data
3) write values from a AAHMI text or other object to a DDE "address" upon "enter"

Thanks a lot
Rich
 

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Can you give us the big picture of what you are trying to accomplish here? do you have a PLC? type of PLC ? type of device?
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

rms

  • Newbie
  • *
  • Posts: 21
    • View Profile
I'm trying to communicate with  software/server  from Bronkhorst called FlowDDE.  The reference manual link  is below - see section 5 for DDE info. 

This software/server polls flow meter data on it's network (FlowBus) and makes the data available via the FlowDDE server.

Unfortunately, the 2 ways to get to the Flow DDE data are DDE (subject of this thread) and ASCII string requests and responses over serial comms (RS232) - too slow.

Flow DDE info here...
https://www.bronkhorst.com/en-us/products-en/accessories-and-software/flowware/flowdde/

Ref manual link here...
https://www.bronkhorst.com/getmedia/4c1645ae-f1f5-4223-87a1-35596bf7df26/Manual-FlowDDE.pdf

When connecting to FlowDDE via Excel - the updates are superfast - like a few / second for up to 20 fields
When connecting PLC to make ASCII string requests - updates take way to long  before get to HMI screen.

Appreciate any help or advice

Thanks
Rich

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
I still did not get your big picture.
It  appears that you have a flowmeter device that either measuring gas/liquid. The device has a built in DDE Server , but the manual also mentioned other interfaces like EtherCat, Ethernet/IP, DeviceNet, Profinet, modbus ...

Anyway, I don't really see how this becomes an issue for AAHMI support. Perhaps, more appropriately to post it in the Open forum.
You should check into using the NDDE library, it will do what you want.
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

rms

  • Newbie
  • *
  • Posts: 21
    • View Profile
Thanks for the reply

It's not a "issue" for support, I was just lookin for info or guidance

The big picture is I need AAHMI to communicate directly with a DDE server and I was inquiring about the best way to do that. Thought there may have been a component or code already available to "drop in" to AAMI

There are multiple liquid  flow meters that are networked together via FlowBus protocol.  A device sits on that network that serves information via DDE only and is accessed through FlowDDE software which facilitates 2 way communication between the flow meters and the outside world via DDE.

All the other interface options like EtherCat, Ethernet/IP, DeviceNet, Profinet, modbus are NOT available on these flow meters - it only communicates over the FlowBus network so I can't use anything else but DDE or ACSII commands to send and receive flow meter data (mostly real)  like flow rate, temp, density, alarm status, setpoint, PV, OP ,etc.
ACSII is too slow, so I'm trying to get the DDE path to work

Thanks for you help
I'll post in another section

Rich