Intranet-Based Management of CAN Devices

Dr.-Ing. Martin Wollschlaeger, Dipl.-Ing. Stefan Wehrmann With the steadily growing use of CAN devices within complex automation systems, the need for effective management solutions becomes more and more obvious. The spreading integration of CAN systems into Local Area Networks (LAN) provides the opportunity to build such solutions on intranet-based technologies like HTTP or COM/DCOM. Particularly the chances of a link between the intranet-stored information and the fieldbus layer let the development of a new generation of management tools be more than likely. Based on the illustration of principles for connecting fieldbus and LAN new concepts for the representation of CAN Higher Layer Protocol structures and data by intranet-based objects are introduced. Examples of practical realizations of the concepts for managing CAN modules prove the feasibility and show the prospects.

1. Introduction providing easy access to manufacturing related data from standard office One of the most outstanding trends in in- environment. This offers a starting point formation technology’s recent develop- for the implementation of management ments is the trend towards network-centric functions for the underlying fieldbus and its systems. Special attention has to be paid components, that are accessible from any to the overwhelming development of the point within the process information Internet and its enabling technologies in system. hard- and software, like TCP/IP, compo- nentware, browser technology, Java etc. 2. Integration concepts Using these technologies in an Intranet on There are different scenarios for the inte- top of a LAN enables the integration of gration of fieldbus systems into LANs different hard- and software platforms, as (Figure 1). PLC based implementations well as the integration of data with different may be integrated using an industrial PC sources, contents and representation. The (IPC) as a gateway. This IPC is connected user interface of an Intranet is imple- to both, the fieldbus and the network, by mented using a browser, a de-facto stan- means of appropriate interface cards. dard software package not only offering an When using an IPC with PC control appli- unique look and feel, but a well known, cations instead of the PLC, the integration user-accepted interface to the underlying becomes more easy. In this case the IPC heterogeneous information system. In can offer the gateway functions in addition addition to the representation of data, to the control applications. Both scenarios more and more management functions of allow data exchange between the fieldbus the networked resources are accessible by components and any other networked a browser. This introduces a new quality equipment. This enables the access from for the management of industrial com- applications of the business management munication systems. as well as from configuration and moni- The steadily growing use of networked toring tools and diagnostic systems to industrial PCs within fieldbus based sys- fieldbus data. Besides the process related tems offers an interesting platform for the data, installation-specific data and de- integration of fieldbusses and LANs. scriptions from databases will be opened These enterprise networks represent the for data access as well. The necessary solution for data exchange in process in- conversion and representation of both formation systems. The main feature of a classes of data - process data and de- process information system is the seam- scriptive data - are more and more per- less integration of fieldbus-based compo- formed using browser-based software nents into systems of the technical and components. economical management of the enterprise, WAN

gateway

configuration, monitoring, diagnosis marketing, business Local Area Network management (LAN) centralized database

IPC IPC PLC

Figure 1: Scenarios for the integration of fieldbusses into a local area network

operating system (OS) OS DCOM DCOM DCOM OLE Auto- client client mation client

COM / DCOM (D)COM

OLE Auto- mation server

CAN network network driver driver driver

CAN ETHERNET

Figure 2: Software structure for the integration of a CAN system into a LAN

A mapping of the fieldbus protocol’s func- way suitable for easy access from the ap- tionality and data structures to appropriate plications relying on fieldbus related data. objects is the major prerequisite for the More and more PC applications use the integration of a fieldbus into an Intranet. (COM) [1]. These objects have to be organized in a Therefor a fieldbus has to be mapped to COM-objects. The access of applications to fieldbus data can be performed using The access of the browser to fieldbus ob- OLE Automation techniques. Such a map- jects is performed using server based ping enables access to fieldbus data from scripts (Figure 3), or as a distributed ap- any OLE Automation capable local client plication using DCOM-Clients (for example application, without having to implement ActiveX-Controls) (Figure 4). application-specific drivers for the fieldbus When using the script based implementa- interface card. In addition, the mapping to tion, a request from a browser initiates the COM objects is a prerequisite for the im- execution of a script at the web server. plementation of Distributed COM (DCOM). This script starts an instance of an OLE DCOM allows access from remote OLE Automation client, that accesses the COM client applications over the network in the objects of the fieldbus mapped to the OLE same way as local clients do. Figure 2 Automation server. The other implementa- shows the principle structure of the inte- tion concept instantiates an ActiveX-Con- gration of a CAN system into an Ethernet trol [3] as a DCOM client. The web server LAN. provides the control for download on de- The access to fieldbus data throughout the mand. The control uses DCOM for access LAN environment is necessary for an to a DCOM server across the network. Intranet based management of fieldbus The DCOM server then uses the OLE components. Intranet based solutions are Automation server to access the fieldbus characterized by: data. • the use of the Hypertext Transport Both concepts are suitable for using a web Protocol (HTTP) as a network-wide browser as an unique interface widely ac- unique logical transport layer, cepted by the users. It provides access to fieldbus data as well as to any other in- • the use of web servers (HTTP servers) formation provided by the networked envi- as data source, and ronment. Especially the direct access to • the use of web browsers (HTTP clients) data in fieldbus related design and con- as a user interface. figuration tools, and to database driven applications will support future complex, but scalable software tools for fieldbus handling.

OS OS OS OS

OLE Auto- HTTP client DCOM server HTTP HTTP client HTTP server mation client (web browser) OLE Auto- server DCOM mation client client

COM / DCOM COM / DCOM DCOM

OLE Auto- mation server OLE Auto- mation server

CAN network network CAN driver driver driver network network driver driver driver

CAN ETHERNET CAN ETHERNET

Figure 3: Server based integration Figure 4: Integration as a distributed application

3. OLE Automation Server for CAN different address spaces, access to prop- erties and methods of objects, and the An important part of the implemented analysis of the interface of unknown ob- prototype solution is the OLE Automation jects. It is the prerequisite for other com- server for CAN. Its tasks are the encap- plex technologies, e.g. OLE Automation, sulation of the underlying driver for the Drag and Drop, OLE Documents and OLE CAN interface card, and the providing of a Controls [2]. Figure 5 shows the COM COM based interface for accessing the object “CAN” with its interfaces in a sche- fieldbus. The COM model defines an matic view. unique, universal expandable binary in- terface enabling data exchange between

Figure 5: Structure of the COM Object “CAN” and its interfaces

The interface IUnknown represents the Interface in order to get a pointer the in- basic interface for all other interfaces. It is terfaces required to handle the properties. the only one, that every COM object has to This method allows further development of implement. IUnknown provides three an object’s functionality by implementing methods for two fundamental properties of additional interfaces without changing ex- the COM object. These properties are isting ones. The clients can use existing used for life-time control of the object by functions without any modification. reference counting, and for navigating The interface IDispatch extends the object between the object’s different interfaces. CAN by implementing the functions nec- Reference counting is performed using the essary to act as an OLE Automation method AddRef called by each client. Par- server. The interface’s methods allow the allel to incrementing the value of the inter- object to be easily accessed from any nal reference counter, this initial conver- script based language like as sation loads the object into the memory. well as from any other programming lan- By calling Release a client closes the con- guage like /C++. The main method of nection with the object. The method dec- IDispatch is Invoke. It calls functions of the rements the reference counter. If the COM object and passes the given pa- counter reaches zero, the object termi- rameters to these functions. The selection nates and is removed from the memory. of the appropriate function is performed The method QueryInterface allows re- using the parameter DISPID. For example, questing for special properties and pro- an OLE Automation client that wants to vides access to the appropriate interfaces. call the object’s function InitCAN passes A client, that wants to access certain the function’s name to the function GetIDs- properties of an object has to use Query- OfNames of the IDispatch interface. GetIDsOfNames returns the DISPID cor- 4.1. Installation using scripts responding to InitCAN. Calling Invoke with This implementation uses the OLE Auto- this DISPID at last results in the execution mation server for CAN described above. of InitCAN. Scripts coded in Visual Basic Script lan- A language like Visual Basic encapsulates guage (VBScript) are running on top of the this sequence. The user only has to code web server. They use the interface IDis- the statement object.InitCAN. It patch provided by the OLE Automation should be mentioned, that this technique server in order to access data and serv- works across the boundaries of processes, ices of the SDS objects. Furthermore, and with DCOM across the boundaries of these VBScripts are used to construct the computers. user interface, which is provided by means of HTML pages. This interface contains As an opposite to IUnknown and IDis- different functional layers, that allows ac- patch, the structure of ICan is not prede- cess to the functionality of SDS objects, as fined by COM or by technologies based on well as to its parameters. Compound COM. The interface ICan represents an documents represent an excellent possi- application specific interface. It has to pro- bility for an integration of SDS objects, vide functions suitable for access to the installation-specific data and descriptions. CAN fieldbus. These functions include for Figure 6 shows a code fragment of a example initialization of the CAN interface HTML page containing the PDF coded on- card and transmitting and receiving of line documentation of an SDS Binary Out- CAN objects. The direct access of the put Object and an interface to scripts for interface’s functions allows, compared with manipulating the status of the Output Ob- an access using IDispatch, a significantly ject. A screenshot of that page is shown in lower access time. However, this Figure 7. advantage can only be used within a given process and not between different proc- esses nor different computers. This is a disadvantage according to an access us- SDS Binary ing IDispatch. Output The CAN driver implemented in the pro-

SDS Binary Output


totype system is a 16-bit driver. This re- quired the OLE Automation server to be a tions are okay for purposes of the man-
16-bit program as well. The direct access

ICan is impossible. So the gap between

closed by using IDispatch. Practical expe- riences have shown, that the timing condi-
agement of CAN modules.
management of CAN modules
... Based on a CAN installation using Smart Code omitted here for brievity Distributed System (SDS) [4] as an appli- ...

SDS Component Modeling Specification cation layer, the feasibility of the integra- ( Online ):

tion concepts are shown. The modules are CAN and a local area network. The web server is implemented as Per- Figure 6: Code fragment of an SDS sonal Web Server on that PC. related compound document This installation requires only the OLE rity relevant data has to be transmitted as Automation server as fieldbus-related ap- plain text, so that the implementation of plication. However, the management-re- further security methods have to be con- lated functions have to be provided by the sidered. scripts. It has to be mentioned, that secu-

Figure 7: Screenshot of a compound document

4.2. Installation using ActiveX-Controls The treeview control on the left side repre- sents the logical structure of the SDS in- This solution requires a DCOM server, that stallation. The access to data in the SDS presents the functions of the OLE components is possible by means of the Automation server to the networked envi- text boxes and buttons on the right side. ronment. The interaction with the user is This data is manipulated by the control’s performed by ActiveX-Controls. After a internal functions and then transferred to download from the web server, these con- the DCOM server that passes the data to trols are automatically instantiated on the the OLE Automation server. It is possible client system, where they reside for further that the OLE Automation server is imple- use. ActiveX-Controls can be integrated mented as a part of the DCOM server. into any ActiveX-Container application. However, it has to be considered that the More and more container applications are OLE Automation server has to access the used as a framework for specialized soft- interface card with its specific interface. ware components. This allows the reuse of The major advantage of the described the controls in a large number of different installation is that the data is transmitted applications. The management functions between the controls and the server in a have to be mapped to the user interface binary format, so that security problems provided by the control. Figure 8 shows a are reduced. screenshot of an ActiveX based management solution for SDS systems.

Figure 8: Screenshot of an ActiveX-based SDS management solution

5. Conclusion and future trends fieldbus data can be performed using the OLE Automation server described above. An intranet based management solution On the other hand, ActiveX-Controls can enables an easy handling of a fieldbus be integrated into Java applets [6], that system as a part of a process information can be used in web browsers or Java ap- system with high complexity. It requires plications. Furthermore, applets or controls the integration of a fieldbus into a local with component-specific management area network. This integration is possible functions can be implemented directly in by implementing appropriate software ob- the fieldbus components. They can be jects, that provide unique interfaces for uploaded via the fieldbus into a network- applications. The integrative aspects of centric application framework. such implementations are considered as a new feature of modern software. The The introduction of Intranet based man- growing success of OPC (OLE for Process agement solutions allows fieldbus handling Control) [5], that also uses a COM based with a new quality in user support. It offers concept, is an example for this. Future a platform and a starting point for further management solutions can be im- developments in information technology, plemented on top of OPC in order to use as well as in electronics and automation fieldbus independent data access meth- and control. ods. References The installation with ActiveX-Controls can [1] Chappel, D.: be integrated into Java based manage- Understanding ActiveX and OLE. ment systems. Java can instantiate and , 1996. access COM objects, so that data ex- change between Java applications and [2] Brockschmidt, K.: Inside OLE. Second Edition. Dr.-Ing. Martin Wollschlaeger Microsoft Press, 1997. Otto-von-Guericke-Universität Magdeburg Institute for Measurement Technology and [3] Denning, A.: Electronics (IPE) ActiveX Controls Inside Out. PO Box 4120, D-39016 Magdeburg, Microsoft Press, 1997. Germany [4] n.n.: Phone: +49 (391) 67-1 46 53 SDS specification. Fax: +49 (391) 5 61 63 58 Honeywell Inc. Microswitch Division, e-: [email protected] GS 052 103 ... GS 052 107, 1995. http://www-nt.et.uni-magdeburg.de/ [5] n.n.: Dipl.-Ing. Stefan Wehrmann OLE for Process Control. 3SOFT GmbH Industry Standard Specification, Wetterkreuz 19a, D-91058 Erlangen, Version 1.0 Germany OPC Task Force, August 29th 1996. Phone: +49 (9131) 7701-159 Fax: +49 (9131) 7701-333 [6] Ladd, S.R.: e-mail: [email protected] Active Visual J++. http://www.3soft.de/ Microsoft Press, 1997.