Remote Automation Solutions Application Notes-Using the DDE Server Manuals & Guides

Open BSI Application Note - Using the DDE Server
Dynamic Data Exchange (DDE) is an industry-standard method for exchanging data between different Windows- application programs. There are many types of application programs which support the DDE standard, such as:
word processing programs spreadsheet programs data base packages equipment maintenance packages loop tuning packages
The Open BSI DDE Server allows such t hird-party applications , which conform to the DDE standard, to obtain data values from specified signals in a controller. In addition, these third-party Windows- applications can write data to signals in the controller.
Starting the DDE Server
Before star ting the DDE Server, Open BSI communications must be activated via NetView. Next, click on Start%>Programs%>OpenBSI Tools%>Collection Programs%> DDE Server. Unless configured for read-only access, or automatic sign­on, you will be prompted to ente r a system pas sword (t his is t he same passwor d used for editing system parameters).9 If the password is successfully entered, the DDE Server will sta rt, and run in a minimized state. No additional BSI configuration is necessary.
Setting Up DDE References in the Third-Party Application
The Open BSI DDE Server supports three DDE functions:
Advise (read continuously) - each time the DDE Server receives a new value from the specified signal, it is sent to the third-party application.
Request (read) - the DDE S erver sen ds the current value of the requested signal to the third-party application. (A Request requires that the Advise function also be active. See Advise, above.)
Poke (write) - the third-party application sends a value to the DDE Server, which sends it to the specified signal in the controller.
9
Because of its ability to write data directly to nodes in the network, the DDE Server, like the
SigWrite utility, is password-protected. Open BSI Application Note Using the DDE Server1
DDE references adhere to the following naming convention:
Service|Topic!Item
For purposes of Open BSI and the DDE Server,
Service is always BSAP Topic is the node name, as defined in the NETDEF files. Item is the signal name in the node. It m ust include the base
name, extension, attribute, and both separator periods, as shown below:
base.extension.attribute
The exact details for definin g the DDE reference in the third-party application vary from application to application. The examples that follow are for two Microsoft® products: Excel and Visual Basic.
Examples - Excel
1) To issue a DDE advise message, which will allow you to display the current value of a signal in a spreadsh eet cell, enter a formula in the cell where you would like the data to appear, as follows:
=BSAP|node!'base.ext.attr'
where: node is the node name as defined in the NETDEF
files.
base.ext.attr is the signal name which will provide the data
value.
for example, to have the value of signal TANK3.LEVEL.01 from the node RPC2 displayed in a spreadsheet cell, enter the formula:
=BSAP|RPC2!’TANK3.LEVEL.01’
2) To issue a DDE poke message, whic h will allow you to write a value to a signal in the controller, you must create an Excel macro as shown below:
=INITIATE("BSAP","node") =POKE(cell1,"base.ext.attr",cell2)
=RETURN()
Using the DDE Server Open BSI Application Note2
where: node is the n o d e n ame as de fin ed i n the NETDE F
for example, the macro:
=INITIATE("BSAP","RPU7")
=POKE(C5,"STATION5.SETPNT.FLOW",E5) =RETURN()
will take the value in cell E5, and send it to signal STATION5.SETPNT.FL OW in node RPU7.
Examples - Visual Basic
files.
base.ext.attr is the signal which will receive the data from
the spreadsheet cell.
cell1 is the cell which contains the INITIATE
command.
cell2 is the cell which contains the data value.
1) To issue a DDE advise, the following properties are used for a text link:
LinkTopic BSAP|node LinkItem base.ext.attr LinkMode 1
The data is available as Caption.
2) To issue a DDE poke, use the following statements for a text box label:
LinkTopic =BSAP|node LinkItem =base.ext.attr LinkMode =2 Text =data LinkPoke
Open BSI Application Note Using the DDE Server3
Configuring the DDE Server For Read-Only Access or Automatic Sign-On
Under normal circumstances, the user is prompted to enter the system password whenever the DDE Server is started.
If desired, howe ver, the DDE S erver can b e config ured for rea d-onl y a cc es s. I n this mode of operation, the DDE Server can only perform advise or request functions; it CANNOT perform the poke function. Because no write access to the controller is provided in this mode, the user will NOT be prompted for the system password.
Another way to eliminate the prompt for the system password is to configure the DDE Server for automatic sign-on. T hi s es se ntially causes the password to be saved and used each time the DDE Server is started.
Configuring Read-Only Access For DDE Server
Click once on the DDE Server icon, then click on
File%>Properties. Click on the "Shortcut" tab in the DDE Server
Properties dialog box. In the "Target" field, leave a
space after DDESERV.EXE, and enter ’NOWRITE’ without quotes.
Click on the [OK] push button to exit the dialog box. The next time the DDE Server is started, it will not allow Poke m essages; it will only support read-only access.
Configuring Automatic Sign-On For DDE Server
Click once on the DDE Server icon, then click on File%>Properties. Click on the "Shortcut" tab in the DDE Server Properties dialog box.
In the "Target" field, leave a space af ter DDESERV.EXE, an d enter the password without quotes.
Click on the [OK] push b utton to exit the dialog box. The next time the DDE Server is started, there will be no prompt for the system password.
Using the DDE Server Open BSI Application Note4
DDE Server Error / Status Messages
The DDE Server generates three different types of Error/Status messages:
Events are reports of normal system activities. Non-fatal Errors are problems which require attention, but which still allow some
DDE Server communication to continue. Fatal Errors cause the termination of all DDE Server activity. Events and Non-fatal errors are
reported in the BSI DDE Server window, which is accessible by restoring the DDE Server icon from its minimized state.
Fatal errors appear in message boxes from which the only choice is to click on [OK] and terminate DDE Server activity.
Message Severity of
Cause
Message
’Cannot Continue, DDE Service Failed! Try
FATAL ERROR
The DDE Server failed because of a Windows problem.
restarting Windows’ ’Cannot continue, BSI not
active. Start BSI then
FATAL ERROR
Open BSI communications are not running.
restart this application.’ ’Cannot continue, BSI
failure. Try restarting
FATAL ERROR
An unexpected message was received from BSI.
BSI.’ ’DDE Server Started’ EVENT The DDE Server started successfully. ’Unable to create a data
handle’ ’Insufficient Memory for
Topic’
NON-FATAL ERROR
NON-FATAL ERROR
Windows resources are unavailable to answer a DDE request.
There is insufficient memory in Windows to communicate with an additional node.
Open BSI Application Note Using the DDE Server5
Message Severity of
Message
Cause
’Insufficient Memory for Conversation’
NON-FATAL ERROR
There is insufficient memory in Windows to collect data from an additional signal.
’New NRT detected’ EVENT Some application has issued a new
Node Routing Table.
’Non-fatal program error on BSI receive’
’Unsolicited message received.’
’Cannot get device address. node deleted.’
’Version Mismatch on device node.’
’Deleting signal
base.ext.attr of device node.’
NON-FATAL ERROR
NON-FATAL ERROR
NON-FATAL ERROR
NON-FATAL ERROR
NON-FATAL ERROR
An inconsistent status was returned for a BSI reply.
An unsolicited message or late reply was received from BSI.
node is not recognized by BSI.
node has been downloaded, and the
new load version is different. The signal base.ext.attr does not exist
in node, and has been deleted from the signal cache.
’Comm restored on device
node.’
’Comm failed on device node.
’Write rejected for signal
base.ext.attr of device node.
EVENT Communication between the DDE
server and node has been restored.
NON-FATAL
Communication with node has failed.
ERROR NON-FATAL
ERROR
Signal base.ext.attr is manually inhibited.
Using the DDE Server Open BSI Application Note6
Returnto the App. Notes Menu
Return to the List of Manuals
Loading...