Applies To:
  • CitectSCADA 5.xx, 6.00
  • CitectHMI 5.xx, 6.00

Summary:
What are some of the most common questions when using DDE and NetDDE in CitectSCADA? 

Solution:
How do I set up CitectSCADA to be a NetDDE Server and connect to it using an Excel Client (DDEFORMU macro)?

Step 1:

a) On the Server machine (the machine running Citect as a NetDDE server), in the RUN prompt, start "DDESHARE"

b) This will bring up the DDE Share on this PC.

c) Click on Shares, DDE Shares

d) Click Add a Share...

Use the above settings.

e) Now click "Permissions".

By default it will have "everyone" with Read and Link control and Administrator with Full control.

f) Click Add... to add a new user.

This will add the new user:

g) The user account OlivierVallee was added under the domain CITSYD.

Click ok.

This will bring you back to the DDE Share Properties screen. Click OK again. This will now bring you back to the DDE Shares screen.

h) Now click on "Citect$" and click on "Trust Share..."

i) Now click Start Application Enable, and Initiate to Application Enable. And Click Set.

Now click OK.

j) This brings you back to DDE Share. You have now setup the NetDDE sharing on the Server side. Click OK and this will hide the DDE Share configuration.

k) Double click on the icon with the Tick, and it will show you the trusted shares on this PC:

l) Close the DDE Share window. You can check in the Process tab in Task manager to verify that NETDDE.EXE is actually running:

Step 2:

a) Now start the Example project on the Server machine. (You can just set it up as stand alone). The server machine is running Windows 2000 SP4. The Citect version I was using is CitectSCADA 5.42r0.

Step 3:

a) Now on the Client PC (running Windows XP SP1) go Start, RUN, "DDESHARE".

b) You don't need to do any special settings here, this just makes sure that NETDDE.EXE is running. Again you can check the Task manager under processes.

Step 4:

a) On the Client PC open Excel.

b) Create a new blank page.

c) In the first cell (doesn't matter which one really) type in the following:

='\\<Server Name>\NDDE$'|'Citect$'!<VariableTagName>

In my instance I had:

='\\syd-olivier2\NDDE$'|'Citect$'!LOOP_1_PV

This showed NA for about 3 seconds, but finally showed the correct value.

d) This has proven that your NetDDE works.

e) Now with the DDEFORMU macro. You can delete the cell we entered above. That is fine. Open the DDEFORMU.xls and enable macro. I am using Macro security level Medium.

f) Right click and select Citect settings:

This will bring the above window up.

I have chosen not to use the Citect.ini file. I clicked "Use Network DDE". You can chose to Restore Defaults on startup or not, the choice is yours.

The Citect Database Path is pointing to the local hard drive (Alternatively you can use UNC folder path to find the Servers Variabe.dbf).

The remote computer name is syd-olivier2

The remote Computer Citect DDE Share Name is Citect$

This (client) computer name is syd-oliviervallee

This Computer's Excel DDE Share Name is EXCEL.

Click OK.

g) Now right click again and select Get Tags. It will flash quickly, and down the bottom it will say Trend.dbf Tags loaded. What it did was load variable.dbf tags, and trend.dbf tags into memory. Again in my instance, this was from the local PC. You could share the project directory on the remote PC and use UNC addressing to specify the location. I will test this and confirm. Yes this does work. I went into the User directory on the remote PC (syd-olivier2) and right clicked on the Example project. Shared it to everyone (no special permission settings). Now in the Citect settings, I used <\\syd-olivier2\Example> for the Citect Database Path.

h) Now right click on the Excel page, and select Citect Select Tags.

Now again, select LOOP_1_PV and click Select on the left. Now click "close". This will paste it into the cell you last clicked on.

After a few seconds the value should display correctly.

What is the format for a NetDDE connection to a remote PC using the DDEDRV driver?

I am trying to use the DDEDRV driver to communicate to Excel on a remote computer via NetDDE. The documentation is not clear as to the format of the address field in the I/O Device field. What is the address format required for such a connection?

The format of the address required for a local connection (DDE) is:

<application>|<topic>

i.e.

Excel|citect.xls

And the format of the address required for a remote connection (NetDDE) is:

<\\<computer> name>\<DDE Share name>|<topic name>

i.e.

<\\syd-olivierv\Excel|citect.xls>

How do I address a Variable Tag array element via a DDE link? The DDE communication standard does not support the transport of Array variable tags. To work around this, you must configure an individual variable tag for each element in the array, and reference this from your DDE Client. For example if you have a Citect Variable Tag: Variable Tag Name: IntArray1 Data Type: INT I/O Device Name: IODev Address: N7:1[10]

You would need to configure 10 tags with address (where X is from 1 to 10): Variable Tag Name: IntArrayElementX Data Type: Digital I/O Device Name: PLC Address: N7:X

 

Keywords:
 

Attachments