Implementation. Schneider Electric PL7 Micro/Junior/Pro - Appendices
Anúncio
Anúncio
OLE Automation Server
5.2
Implementation
Introduction
Subject of this sub-section
What's in this
Section?
This sub-section describes the procedure for implementation of the OLE Automation server
This Section contains the following Maps:
Topic
Installation of OLE Automation
Accessing the PL7 OLE Automation server
Server start in local mode (COM mode)
Server start in remote mode (DCOM)
Implementing the server in remote mode
PL7 Server execution modes
Input points: OLE Function
Page
76
TLX DR PL7 xxE
OLE Automation Server
Installation of OLE Automation
Description l l
Installation of the PL7 product OLE Automation Server is transparent for the user, as it self-installs during PL7 installation.
The installation includes: l Four OLE Automation client examples, complete with source code and README file supplied with the software.
These examples are: l l a "minimal" visual C++ 4.2 client: the minimum needed to be able to write an
OLE client.
a "complete" visual C++ 4.2 client, which makes use of all the available input points.
l a visual Basic 5.0 client, which makes use of all the available input points.
l an Excel client.
A *.h file which defines the value of the error codes generated by the server.
A TLB interface file for a Visual C++ client.
TLX DR PL7 xxE
77
OLE Automation Server
Accessing the PL7 OLE Automation server
Local access
The PL7 OLE Automation server offers two ways to access its utilities.
The client application and the PL7 OLE Automation server are on the same terminal.
Remote access via DCOM
The client application and the PL7 Automation server are on two separate terminals which are linked by the TCP/IP network:
Client station Server station
DCOM
78
TLX DR PL7 xxE
OLE Automation Server
Server start in local mode (COM mode)
Introduction COM mode (Component object Model) defines an interface for communication between applications. It provides independence from the development tools.
Server start in local mode (COM mode)
To start the server in local mode, follow the procedure below:
1
2
3
4 declare an object " A " on the client application to communicate with the server application
Execute a Createdispatch function on object " A " from the client application in order to instantiate the server application
Save PL7Pro as OLE server in the register base for correct operation in server mode
(the link between the client application and the server application is created if the latter is referenced in the register base).
The client application can now interrogate the server application via the interface accessed through object "A".
E.g.: OpenStx("C:\appli.stx).
TLX DR PL7 xxE
79
OLE Automation Server
Server start in remote mode (DCOM)
Introduction The PL7 server runs according to the information present in its register base. It can be located on the client machine or on a remote machine.
DCOM mode is an extension of COM (Component Object Model) mode. COM mode is used for a client application and a server application to communicate with each other on one machine.
DCOM mode is used for two remote machines to communicate with one another. It replaces inter-process communication protocols with network protocols.
Illustration of OLE Automation operation in remote server mode:
Driver choice
PL7Servur
Client
PC a
Client
Client
PC b
COM run-time
Security provider
DCE RPC
Protocol stack
Driver choice
PL7Server
PC c
COM run-time
Security provider
DCE RPC
Protocol stack
Component
DCOM network protocol
80
TLX DR PL7 xxE
Configuration utility
OLE Automation Server
To establish communication between two machines, we use a configuration utility called, "DCOMCNFG.EXE".
By default, the utility "DCOMCNFG.EXE" included in Windows 95. The user must connect to the following Internet address: " http://www.microsoft.com " and search on this site to download this utility. This allows the server to operate in
DCOM when running Windows 95.
TLX DR PL7 xxE
81
OLE Automation Server
Implementing the server in remote mode
Example of use
Procedure
Let’s suppose a machine A (Windows NT 4) installed with a PL7Pro server.
The machine user must log in as "administrator" in order to manage access rights.
The client is machine B (Windows 95).
Follow the procedure outlined below:
1 Start DCOMCNFG on machine B: l Select the «Default Properties» tab to view the following information: l l
[X] "Enable Distributed COM on this computer"
Default Authentication Level: CONNECT l l Default Impersonation Level: Identify
On the «Default Security» tab, check the option: l l [X] Enable remote connection
On the «Application» tab: l Select PL7Pro server "PL7 server", then "properties"
2 Start DCOMCNFG on machine A: l Select the «Default Properties» tab to view the following information: l l
[X] «Enable Distributed COM on this computer
Default Authentication Level: CONNECT l Default Impersonation Level: Identify
3 Machine B, the "Client" can control PL7Pro server" located on machine A.
4 Select the «Default security» tab, and add the users who are to have write authorization on the machine.
For more information
There are Newsgroups on the Internet, where you can ask questions about DCOM.
82
TLX DR PL7 xxE
OLE Automation Server
PL7 Server execution modes
Introduction
Execution modes
The OLE Automation PL7 server has two execution modes which can be chosen dynamically during execution (see SetHMIServer ) l l
Execution mode without HMI. The PL7 is started as a "background task", with no display or possibility of operator input. It is the mode used typically, for example, to automate repetitive tasks or to access application information contained in an stx file.
Application mode with HMI. The PL7 is started as an "interactive" PL7 with display and the possibility of operator input but it remains receptive to commands from its client application. This mode has been developed to view the program or configuration elements of an application contained in an stx file using external tools such as DIAG Viewer.
Note: Utilities for displaying programs, tools, and modules can only be executed in the mode with HMI.
The OLE Automation PL7 server in HMI mode is subject to monitoring of user rights. It is set in "Read Only" user profile, which corresponds to its code display and PL7 I/O module display role.
When not in HMI mode the OLE Automation PL7 server is not subject to monitoring of user rights but the application cannot be modified with the utilities provided.
TLX DR PL7 xxE
83
OLE Automation Server
Input points: OLE Function
Introduction
Execution context l l l l
There are four types of input points:
Execution context
API monitoring
Read information
Application element display
Input points
Name
OpenStx
SaveStx
CloseStx
Set DriverAndAddress
SetServerHMI
GetPL7HMI
GetMessageError
Description
Opening an application
Saving the active application
Closing the active application
Setting the driver and the address of the accessed PLC
Making the OLE Automation PL7 server interactive or noninteractive
Giving the status: open or closed application, local – online mode , API status
Reads the error message associated with the error code
API monitoring Input points
Name
ConnectPLC
DisconnectPLC
SenCommandToPLC
DownloadToPLC
UploadFromPLCM
Description
Enters online mode
Exits online mode
Command sent to the PLC (RUN, STOP INIT)
Loading the active application into a PLC
Copies a PLC application into the active application
84
TLX DR PL7 xxE
OLE Automation Server
Read information Input points
Name
ExportScyFile
ExportFefFile
GetSymbol
GetSTXAppIdentity
GetPLCAppIdentity
GetServerVersion
Application element display
Input points
Name
SetPosPL7Window
ShowProgram
CloseProgram
ShowIOModule
CloseIOModule
ShowDFB
CloseDFB
OpenTool
Description
Exports the symbols in the active application as an scy file
Exports the active application as an fef file
Reads the symbol and the comment associated with an address
Reads the general application information contained in an
STX file
Reads the general application information contained in a
PLC
Reads the server version
Description
Sets the PL7 display characteristics (position and form)
Opens an editor on a given program module
Closes a program editor
Opens an editor on a given I/O module
Closes a given I/O module editor
Opens an editor on a given DFB code
Closes a editor on the given DFB code
Opens any MDI tool without context
Note: The input points concerning application element display do not work if the server is not in HMI mode.
TLX DR PL7 xxE
85
Download
Anúncio