retrieval system, or transmitted, in any form, or by any means, mechanical,
electronic, photocopying, recording, or otherwise, without the prior written
permission of OMRON.
No patent liability is assumed with respect to the use of the information
contained herein. Moreover, because OMRON is const antly striving to improve
its high-quality products, the information contained in this manual is subject to
change without notice. Every precaution has been taken in the preparation of
this manual. Nevertheless, OMRON assumes no responsibility for errors or
omissions. Neither is any liability assumed for damages resulting from the use
of the information contained in this publication.
Who Should Read This DocumentSECTION 1 Introduction
SECTION 1
Introduction
The purpose of this document is to act as an introduction and reference guide
to the CX-Supervisor .NET interface introduced in V3.0.
1-1Who Should Read This Document
The target audience is application developers knowledgeable in the .NET
Framework and using external libraries. No attempt is made to teach .NET
practices or any programming language.
1-2Interface Overview
The CX-Supervisor .NET interface allow external applications to access CXSupervisor using well defined interfaces to access specific areas of
functionality. The interface can be divided in to the following areas of
functionality:
•Point monitoring and data gathering
•Application/System management
•Alarm monitoring and control
•Script execution
•Error management
The reference section of th is document provides full details of the class es an d
methods which implement this functionality.
1-3Referencing the DLL
The interface is exposed through the file SCSRUNLib.dll which is located in
the CX-Supervisor installation directory. In order to use the interface classes
you must first add a reference to it in your project and then insert an
appropriate using or Imports declaration in your class.
7
Referencing the DLLSECTION 1 Introduction
8
VB .NETSECTION 2 Examples
SECTION 2
Examples
These code snippets are provided as an example of how to use the CXSupervisor .NET Interface.
2-1VB .NET
' declare variables
CErrorMngtClass errorMngr = new CErrorMngtClass();
object list;
' get list of errors
errorMngr.GetErrorLog(out list);
' convert list to string array
string[] errors = (string[])list;
' use error log…
2-2C# .NET
// declare variables
CPointMngtClass pointMngr = new CPointMngtClass();
object list;
// get list of points
pointMngr.ListPoints(out list);
// convert list to string array
string[] points = (string[])list;
// use points list…
2-3VB .NET and ASP.NET
The source code for the CX-Supervisor Standard Web Pages is installed along
with CX-Supervisor. It can be opened and run using Visual Web Developer
2008. The Express edition of this software is available as a free download
from Microsoft.
9
VB .NET and ASP.NETSECTION 2 Examples
10
PointMngtSECTION 3 Class Reference
SECTION 3
Class Reference
3-1PointMngt
Allows the client to manage the acquisition of point information and the
reading and writing of point data.
3-1-1ListGroups
Retrieves a list of all the point groups contained within a CX-Supervisor
application.
ListGroups(ByRef pGroups As Object)
Parameters Description
pGroupsAn array of strings representing the names of all the groups
3-1-2ListPoints
Retrieves a list of all the points that are part of the given group.
ListPoints(ByVal szName As String, ByRef pPoints As
Object)
3-1-3SetValue
3-1-4GetValue
Parameters Description
szNameName of Group
pPointsReceives an array of strings representing the names of all the
points contained in the group
This method sets a point to a specified value. In circumstances where the
point can not be set to a value (i.e. More than allowed maximum) the value
returned in the retVal parameter will differ from that specified and represent
the actual value the point was set to.
SetValue(ByVal szName As String, ByVal varValue As Object,
ByRef retVal As Object)
Parameters Description
szNameName of Point
varValueValue the point is to be set to
retValThe actual value the point was set to
Reads the current value of a point.
GetValue(ByVal szName As String, ByRef retVal As Object)
Parameters Description
szNameName of Point
retValReceives the current value of point
11
PointMngtSECTION 3 Class Reference
3-1-5IsValidPoint
Determines whether the point is valid.
IsValidPoint(ByVal szName As String, ByVal szGroup As
String, ByRef retVal As Integer)
Parameters Description
szNameName of Point
szGroupName of Group
retValReceives true or false
3-1-6IsValidGroup
Determines whether the group is valid.
IsValidPoint(ByVal szName As String, ByRef retVal As
Integer)
Parameters Description
szNameName of Group
retValReceives true or false
3-1-7GetPointData
3-1-8BrowsePoints
Retrieves the metadata of a specific point
GetPointData(ByVal szName As String, ByRef vartype As
UShort, ByRef pDescription As Object, ByRef bReadOnly As
Integer, ByRef iArraySize As Integer, ByRef Value As
Object)
Parameters Description
szNameName of the Point
vartypeThe type of point
pDescription The description of the point
iArraySizeNumber of array elements (1 = non array point)
valueThe current value of the point
This method retrieves a filtered list of the points contained within a CXSupervisor application.
BrowsePoints(ByVal szFilter As String, ByVal szGroup As
String, ByVal vtDataTypeFilter As UShort, ByRef pPoints As
Object)
12
Parameters Description
szFilterFree format filter eg. “P*”
szGroupGroup name filter
ApplicationMngtSECTION 3 Class Reference
Parameters Description
vtDataTypeF
ilter
pPointsReceives an array of strings representing the names of all the
3-2ApplicationMngt
Allows the client to retrieve Application level information and manage the
running application.
3-2-1GetErrorString
This method returns the error string corresponding to a specific error code
generated by CXSupervisor in response to a method call on the custom
interface.
GetErrorString(ByVal dwError As Integer, ByRef pString As
Object)
Parameters Description
Data type filter. One of:
0 - All types
11 - Boolean
3 - Integer
5 - Real
8 - String
points that pass the filters
dwErrorA valid component specific error code that the client had
pStringReceives a string error message
3-2-2Restart
Causes the CX-Supervisor runtime to be restarted. If a path to a .SR2 file is
specified then this is run upon restart.
Restart(ByVal szFile As String)
Parameters Description
szFileOptional path of the SCS application to run.
3-2-3GetProjectName
Returns the name of the running CX-Super viso r app lica tion pr ojec t.
GetProjectName(ByRef pName As Object)
Parameters Description
pNameReceives the name of the project
returned from an interface function from the component. For
which the client application is requesting the server’s textual
representation
13
ApplicationMngtSECTION 3 Class Reference
3-2-4ListDevices
Retrieves a list of all the devices contained within a CX-Supervisor application.
ListDevices(ByRef pDevices As Object)
Parameters Description
pDevicesAn array of strings representing the names of all the devices
3-2-5GetDeviceStatus
Retrieves the status of a device
GetDeviceStatus(ByVal szName As String, ByRef pOpen As
Integer, ByRef pCommsFailed As Integer, ByRef pInError As
Integer)
Parameters Description
szNameName of the device
pStatusReceives the status of the device
3-2-6GetAppId
Returns a App ID string that can be used to identify the instance of this
runtime.
GetAppId(ByRef pAppId As Object)
3-2-7IsValidAppId
3-2-8IsValidUser
Parameters Description
pAppIdReceives the App ID
This method determines whether the given App ID matches the current’s
instance’s App ID.
IsValidAppId(ByVal szAppId As String, ByRef retVal As
Integer)
Parameters Description
szAppIdThe App ID to validate
retValReceives true or false
This method determines whether the given username and password matches
a configured CXSupervisor runtime user with web access enabled.
IsValidAppId(ByVal szUsername As String, ByVal szPassword
As String, ByRef retVal As Integer)
Parameters Description
szUsername A username to validate
14
szPassword A password to validate
retValReceives true or false
AlarmMngtSECTION 3 Class Reference
3-3AlarmMngt
Allows the client to view alarm state and history and acknowledge active
alarms.
3-3-1ListAlarmGroups
Retrieves a list of all the alarm groups contained within a CX-Supervisor
application.
ListAlarmGroups(ByRef pGroups As Object)
Parameters Description
pGroupsReceives an array of strings representing the names of all the
alarm groups
3-3-2ListAlarms
Retrieves a list of all the alarm contained within the given alarm group.
ListAlarms(ByVal szName As String, ByRef pAlarms As
Object)
Parameters Description
szNameName of Alarm Group
3-3-3GetAlarmData
pAlarmsReceives an array of strings representing the names of all the
alarms
Retrieves the metadata of a specific alarm.
GetAlarmData(ByVal szName As String, ByRef pType As
Object, ByRef pAuto As Integer, ByRef pDescription As
Object, ByRef pPriority As Object, ByRef pStatus As
Object, ByRef pDateTime As Object, ByRef pMessage As
Object)
Parameters Description
szNameName of the Alarm
pTypeThe type of Alarm “simple”, “deadband”, ”rateofchange”
pAutoIndicates Automatically acknowledged
pDescription The description of the alarm
pPriorityThe priority of the alarm
“Highest”, “High”, “Medium”, “Low”, “Lowest”
pStatusThe current status of the alarm
“Inactive”, “Active”, “Acknowledged”
pDateTimeThe time and date the alarm entered it’s current state
pMessageThe message shown
15
AlarmMngtSECTION 3 Class Reference
3-3-4AcknowledgeAlarm
Acknowledge an alarm.
AcknowledgeAlarm(ByVal szName As String, ByVal szUser As String)
Parameters Description
szNameName of Alarm
szUserUser who acknowledged alarm
3-3-5AcknowledgeAllAlarms
Acknowledge all un-acknowledged, active alarms.
AcknowledgeAllAlarms(ByVal szUser As String)
Parameters Description
szNameName of Alarm
szUserUser who acknowledged alarms
3-3-6BrowseAlarms
This method retrieves a filtered list of the alarms contained within a CXSupervisor application.
BrowseAlarms(ByVal szFilter As String, ByVal
szPriorityFilter As String, ByRef pAlarms As Object)
Parameters Description
szFilterFree format filter eg. A*
szPriorityFilterAlarm priority filter. Eg. “High”. If string empty all types are
pAlarmsReceives an array of strings represen tin g th e na m es of all the
3-3-7GetAlarmLog
This method provides the ability to get a list of all the alarm log entries. The
returned array strings each delimitated by tabs will provide time, message and
status information. The list matches the order of entries in the log.
GetAlarmLog(ByRef pAlarmLogEntries As Object)
Parameters Description
pAlarmLogE
ntries
3-3-8GetActiveAlarms
Retrieves a list of all the currently active alarms.
GetActiveAlarms(ByRef pAlarms As Object)
returned
alarms
Receives an array of strings representing the alarm log entries
16
Parameters Description
pAlarmsReceives an array of strings represen tin g th e na m es of all the
alarms
ScriptMngtSECTION 3 Class Reference
3-4ScriptMngt
Allows the client to execute scripts contained within a supervisor application.
3-4-1ExecuteScript
Execute a project level script in the supervisor application.
ExecuteScript(ByVal varName As Object, ByRef pParamList As
Object, ByRef retVal As Object)
Parameters Description
varNameName of script
pParamListArray of objects representing the list of script arguments
retValReturned output parameters
3-4-2ListScripts
Retrieve a list of all the project level scripts contained within a CX-Supervisor
application.
ListScripts(ByRef pScripts As Object)
Parameters Description
pScriptsReceives an array of strings representing the names of all the
3-4-3GetScriptParameters
Retrieves the parameters associated with a script.
GetScriptParameters(ByVal szName As String, ByRef
pParamList As Object)
Parameters Description
szNameThe name of the script
pParamListReceives an array of strings representing the data types of the
3-5ErrorMngt
Allows the client to access to the error log.
3-5-1GetErrorLog
Get a list of all the error log entries.
GetErrorLog(ByRef pErrors As Object)
Parameters Description
scripts
parameters
pErrorsReceives and array of strings representing the all of the error
log entries (date/time and message)
17
ErrorMngtSECTION 3 Class Reference
18
Revision history
Revision history
A manual revision code appears as a suffix to the catalog number on the front
cover of the manual.
Cat. No. W15E-EN-01
The following table lists the chan ges made to the manual during each revision.
The page numbers of a revision refer to the previous ver sio n.
Revision
code
01Sept. 2010First version in the standard Omron format.
DateRevised content
19
Revision history
20
Authorized Distributor:
Cat. No. W15E-EN-01 Note: Specif cations subject to change without notice.
Printed in Europe
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.