Implementation. Schneider Electric PL7 Micro/Junior/Pro Appendices
Iklan
Iklan
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 topics:
Topic
Installation of OLE Automation
Accessing the PL7 OLE Automation server
Server Start in Local Mode (COM Mode)
Remote Mode Server Launch (DCOM)
Installation of the server in the remote mode
PL7 Server execution modes
Input points: OLE Function
Page
84
35013153.01 07/2008
OLE Automation Server
Installation of OLE Automation
Description Installation of the PL7 product OLE Automation Server is transparent for the user, as it self-installs during PL7 installation.
The installation includes: z z z
Four OLE Automation client examples, complete with source code and README file supplied with the software.
These examples are: z z 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.
z z a visual Basic 5.0 client, which makes use of all the available input points.
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.
35013153.01 07/2008
85
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
86
35013153.01 07/2008
OLE Automation Server
Server Start in Local Mode (COM Mode)
Introduction
Server Start in
Local Mode
(COM Mode)
COM mode (Component object Model) defines an interface for communication between applications. It provides independence from the development tools.
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).
35013153.01 07/2008
87
OLE Automation Server
Remote Mode Server Launch (DCOM)
Introduction The Pl7 server is executed as a function of information present in the list base. It can be located on a client or remote machine.
The DCOM mode is, in fact, an extension of the COM mode (Component Object
Model). The COM mode facilitates a dialog between a client application and a server application on the same machine.
The DCOM mode facilitates a dialog between two remote machines. It replaces the inter-process communication protocols with the network protocols.
Illustration of the OLE Automation operation in the remote server mode:
Driver selection
PL7 server
Client
PC a
Client
Client
PC b
COM run-time
Security provider
DCE RPC
Protocol stack
Driver selection
PL7 server
PC c
COM run-time
Security provider
DCE RPC
Protocol stack
Component
DCOM network protocol
88
35013153.01 07/2008
OLE Automation Server
Installation of the server in the remote mode
Introduction
Client configuration
DCOM is a specific configuration required on a client PC to support remote access to the PC on which the server (PL7 Pro Server) is installed. On a PC supporting
Windows XP Professional or Windows VISTA Professional Edition 32, DCOM must be configured by using the DCOMCnfg.exe
tool.
The following procedure shows how to configure the DCOM and is applied to
Windows XP Professional and Windows VISTA Professional Edition 32 operating systems:
Step Action
1 z z
Launch DCOMCnfg.exe
located in the list:
C:\Windows\System32
Then on the icon ‘ Console source
→
Component service
→
Computers
→
Work station , display the properties using the right click of the mouse or,
Click on Configuration panel
→
Administration utilities
→
Component services .
In the window that appears, click on Component services
→
Computers .
On the Work station icon, display the properties using the right click of the mouse.
2
3
In the Default properties tab, check that: z z z
The option
The
The
Activate Distributed COM (DCOM) on this computer
Default authentification level
Default identity loan level
field is defined on
field is defined on
Connect
Identify .
.
is selected.
In the COM Security tab:
Modify the Access authorization list in order to make sure that the SYSTEM ,
INTERACTIVE , NETWORK and Everyone users are figured. This last parameter is only required to authorize the server to resend the notifications to the client.
35013153.01 07/2008
89
OLE Automation Server
Server configuration
These configuration parameters must be defined when connected to the machine when you use an account with the authorizations required for access and server start-up.
Step Action
1 z z
Launch DCOMCnfg.exe
located in the list:
C:\Windows\System32
Then on the icon ‘ Console source
→
Component service
→
Computers
→
Work station , display the properties using the right click of the mouse or,
Click on Configuration panel
→
Administration utilities
→
Component services .
In the window that appears, click on Component services
→
Computers .
On the Work station icon, display the properties using the right click of the mouse.
2
3
In the Default properties tab, check that: z z z
The option
The
The
Activate Distributed COM (DCOM) on this computer
Default authentification level
Default identity loan level
field is defined on
field is defined on
Connect
Identify .
.
is selected.
z z
In the list DCOM configuration
→
OLE Automation , display the properties using the right click of the mouse. The Properties of OLE Automation Server dialog box will appear.
z Click on the Identity tab. The Interactive user option must be selected. The This user option with an appropriate password must be selected.if no user is connected to the server or if the session is modified or interrupted without a cause.
Click on the
Click on the
General
Slot
tab, the authentification level must be defined on
tab, the Execute the application on this computer
By default .
option must be z selected.
In the tab Security
→
Authorizations for execution and activation , select z z
Personalize .
Click on Modify , the Authorization for execution dialog box will appear.
Click on Add , add the users, then authorize the access (the SYSTEM ,
INTERACTIVE , NETWORK and Everyone users must be figured in this list, z z Click on OK to close the dialog boxes.
In the tab Security
→
Access authorizations , select Personalize .
z Click on Modify , the Authorization for access dialog box will appear.
z Click on Add , add the users, then authorize the server launch (the SYSTEM , z
INTERACTIVE and NETWORK users must be figured in this list, others such as
Everyone can be added).
Click on OK to close the dialog boxes.
Note: If the client and the server do not belong to the same XP or VISTA domain, or if no XP or VISTA domain exists, do not forget that the identical users using an identical password must be created on the two machines (ensure that the damage is taken into consideration).
90
35013153.01 07/2008
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 ) z z
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.
35013153.01 07/2008
91
OLE Automation Server
Input points: OLE Function
Introduction
Execution
Context
There are four types of input points: z z z z
Execution context
API monitoring
Read information
Application element display
Input points
Name
OpenStx
SaveStx
CloseStx
Set DriverAndAddress
SetServerHMI
GetPL7IHM
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, offline – online mode , PLC status
Reads the error message associated with the error code
PLC Monitoring Input points
Name
ConnectPLC
DisconnectPLC
SenCommandToPLC
DownloadToPLC
UploadFromPLCM
DownloadStationWithSym bol
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
Loads an application and its zipped symbols database into the PLC
92
35013153.01 07/2008
OLE Automation Server
Read Information Input points
Name
ExportScyFile
ExportFefFile
GetSymbol
GetSTXAppIdentity
GetPLCAppIdentity
GetServerVersion
CompareSymbolPCAndSymb olPLCAppli
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
Lets you know the general application information contained in a PLC
Application
Element Display
Input points
Name
SetPosPL7Window
ShowProgram
CloseProgram
ShowIOModule
CloseIOModule
ShowDFB
CloseDFB
OpenTool :
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.
35013153.01 07/2008
93
Unduh
Iklan