Presentation is loading. Please wait.

Presentation is loading. Please wait.

Cimetrix CIMConnect Training

Similar presentations


Presentation on theme: "Cimetrix CIMConnect Training"— Presentation transcript:

1 Cimetrix CIMConnect Training
An introduction to CIMConnect, the Cimetrix SECS/GEM product This training course includes: an overview of the GEM standard detailed usage instructions of the CIMConnect product. It does not include: GEM Host Manager training.

2 All the green boxes may be customized, but it is an advanced feature
All the green boxes may be customized, but it is an advanced feature. The light grey are pieces that the customers will always do themselves. The dark grey are all standard built-in features that you cannot change Non-volatile storage: The GEM standard defines some of datas that should be stored. We store that automatically on the Hard disk. If the customer wants to save some other way, he could replace our dll with a custom one. The other green boxes are typically things we implement with CIMConnect Pro. Project definitions are the machine specific lists of variable, collection events and alarms available to all host. Built-in definitions are the GEM required lists of variable, collection events and alarms. We have implemented that in CIMConnect. Project methods are special start-up and shut down methods (for CIMCoonect) that the customer may implement. Project Host Definitions are the machine specific lists of variable, collection events and alarms available to one specific host. Built-in Host definitions are the GEM required lists of variable, collection events and alarms available to one specific host. States Machines are the GEM state Machines to one specific host Built-in Tasks are the tasks specific to an host and define all the SECS-II messages. If you use GW/GEM, you need to create a program and compile it to talk to a host. With CIMConnect, you just install it and are immediately able to talk to the host. CIMConnect API interface is what the customer uses to implement his GEM interface. (bunch of COM object and C++ wrappers). CIMConnect Product tools: we provide ActiveX controls to implement GEM requirements in the GUI. GW/GEM provides nothing. We also provide a control panel which is a utility to setup CIMConnect and to view the status of the GEM interface and to simulate the activity in the GEM interface.

3 EMService.exe Windows Service can be configured to:
Manual startup (preferred) Always starts up automatically (COM feature) Runs Equipment Managers Most machines have only one Equipment Manager Equipment Manager ID = “0” Reads “.epj” project file at startup

4 EMService.exe Startup Defaults
EMService settings are located in the Windows registry: HKEY_LOCAL_MACHINE\SOFTWARE\Cimetrix\CIMConnect\Equipment Includes optional default logging settings Includes optional default communication settings

5 EMService Tool Tray Tool Tray icon Right-click for menu Color Status
Logging settings Diagnostics Manual Shutdown Color Status Green is communicating Yellow & Blue are NOT communicating Black during startup

6 Equipment Manager(s) Non-Volatile Storage (NVS) is provided to store:
Persistent Variables Collection Event Reports Collection Event / Report Links Spool Table (Streams/Functions that will spool when active) Spooled messages The default location for the NVS directory is: C:\CIMConnectProjects\Equipment1\Nvs Before starting up CIMConnect, the NVS directory can be deleted. Restores the default CIMConnect settings. CIMConnect will recreate the NVS directory as needed.

7 Equipment Manager(s) Manages “common” GEM items that are available to all host connections: Variables Collection Events Alarms Manages host connection specific items: These items are defined in the “.epj” project file

8 Equipment Manager(s) CIMConnect provides API functions that can be used in .NET, C++, or other development environments that support COM The interfaces provided include: ICxEMService Used to start and stop EMService and get your application connected ICxClientApplication Provides most of the GEM functionality. ICxClientTool Provides functionality to manage your project… such as creating variables, alarms, and events. ICxHostEmulator Allows your application to perform tasks which are typically only done by the host… such as enabling collection events. Several callback interfaces are also provided. To use these interfaces, the client application must implement them and register the callback functions with ICxClientApplication.

9 Host Interface(s) EMService supports multiple host connections
Each connection manages it’s own independent GEM state machines: Communication State Control State Spooling State Limit State Connection-Specific Variables, Events Communication Interface SECS-I or HSMS Change settings on-the-fly! ActiveX Control Custom CIMPortal Data Collection

10 SECSConnect Host Sample
Simple host example Source code located in the examples folder Demonstrates: dynamic communication settings Send/Receive messages Logging Developed using Visual C++ 6.0

11 CIMConnect Control Panel
This is a utility program the comes with CIMConnect. Among other things, this utility allows you to: Monitor GEM states View variables, alarms, events View defined reports View traces Limits Make changes to your project (not recommended) ActiveX Controls are used throughout. These same controls are available for client applications.

12 Product Documentation
API Manual an users guide is provided in a “.chm” help file: C:\Program Files\Cimetrix\Comm Products\Documentation\CIMConnectDev.chm Release Notes: C:\Program Files\Cimetrix\Comm Products\Documentation\CIMConnectReleaseNotes.htm An MS Word™ template is provided to help get you started with your GEM interface documentation. C:\Program Files\Cimetrix\Comm Products\support\CIMConnect\CimetrixGEMInterface.dot

13 Programming Samples Examples have been provided for different programming environments including: C, Visual C++, C# .NET, and VB.NET Examples can be found under: C:\Program Files\Cimetrix\Comm Products\Examples\CIMConnect The source code for the ActiveX controls used in CIMConnect Control Panel are provided in the EMTools folder.

14 CIMConnect Project Development
Converting machines into GEM-compliant SEMI Equipment

15 Steps To Interface Development
Host connection setup (epj file) Project Configuration Project Programming User Interface Interface Manual

16 Setup the communication for each host connection
1. Host Connection Setup Setup the communication for each host connection

17 Primary Tasks Determine the number of Host connections
Modify connection settings Modify default communication settings for each connection Decide which features you want to support for each connection

18 Host Connection Settings
Connection settings are located in the “.epj” project file under the [CONNECTION#] sections “name” gives the connection a name. You can see this name in CIMConnect Control Panel The “encoder” and “decoder” lines are used to change the CODEC that is used to encode and decode messages. This is an advanced feature and this line is rarely ever changed. “commif” is the Communication Interface Selection. This is also an advanced feature, and the line is rarely changed. “useregforcommifcfg” was added to allow communication settings to be loaded from the registry (if exists) instead of from the “commifcfg” string in the “.epj” file. This is especially useful when your equipment GUI provides a way for the operator to change communication settings. “commifcfg” setting is described on the next slide

19 Default Communication Setup
In the “.epj” project file, change the commifcfg line under each [CONNECTION#] This string can be configured to use SECS-I or HSMS-SS. See the help file sections for more details on the string format: Tutorial/Host Interface Setup/Host Connections/Communication Settings/Create a CxSMS Initialization String for SECS Tutorial/Host Interface Setup/Host Connections/Communication Settings/Create a CxSMS Initialization String for HSMS-SS Use IP Address Communication setup may be changed while running using the ICxClientApplication SetCommIF() or SetCommIF2() functions without rebooting or restarting Communication settings can be made persistent (without changing the commif string in the epj file)

20 Connection Specific Features
These settings affect only one host interface. Some Examples: Enable/Disable GEM using 2043=GEMEnable Enable/Disable Remote Commands using 2044=RemoteCmdEnable Enable/Disable Terminal Services using 2047=HostTermMsgEnable Enable/Disable Process Program Management using 2045=HostPPEnable Select S6F11 or S6F13 event reports. S6F11 is typically used.

21 EPJ Files Items are comma-delimited # Comment
Host connection settings are under the [CONNECTION#] sections Logging settings are under the [CONFIG] section Default Status Variable, Data Variable, Equipment Constant definitions Default Collection Event definitions Default Alarm definitions EPJ items can be added or changed during runtime using the ICxEMTools interface

22 2. Project Configuration
Define the machine’s variables, alarms, and events

23 Primary Tasks Configure Built-In (Well-Known) definitions
Create all machine-specific data variables, status variables, equipment constants, alarms, and collection events

24 Common & Connection Definitions
Common variables, collection events, and alarms are visible to all hosts. Connection specific items are only visible to that host

25 Well Known Definitions
Several items in the EPJ file are defined with Well Known names CIMConnect uses the Well Known name to access these items rather than the ID or name Customers may change the IDs and names of these items without breaking CIMConnect Changing the Well Known name or value types for these items could break the CIMConnect features that use them Customers should not define their own Well Known items Most must be defined in “.epj” file

26 Definition Properties
Variables, Collection Event, and Alarms have these properties: “id” Uniquely identifies the item to the host “name” Uniquely identifies the item for programming and documentation “description” Provide enough information so that the host or operator understands its functionality and values. This is optional. WARNING! Don’t use a comma (,) or pound (#) characters!

27 Variable Definitions “units” “VarType” or Variable Type “ValType”
Valid SECS-II unit specifier. This field is optional “VarType” or Variable Type SV = Status Variable DV = Data Variable EC = Equipment Constant “ValType” is the type of data the variable stores: A, U1, U2, U4, U8, I1, I2, I4, I8, F4, F8, Bo, Bi, L “eventID” Enables the value for limit monitoring. This is the event ID that gets triggered when a limit boundary is crossed. This event must be unique. This field is optional. “private” Private items are not visible to the host. This field is optional if not private.

28 Variable Definitions (cont.)
“persistent” When set equal to “1”, the value will be saved to non-volatile storage (in the NVS directory) whenever it is changed. The variable will be set equal to the value stored in NVS during startup rather than using the “default” field. This field is optional if not persistent. “min” This is the minimum value. Make sure the type is the same as “ValType”. Do not use this field for ASCII (A) or List (L) types. This is an optional field. “max” This is the maximum value. Similar to “min” “default” the initial value on startup (unless non-volatile). Make sure the type is the same as “ValType”. Default may be empty. “wellknown” As described earlier, CIMConnect uses this to access EPJ items instead of the “id” and “name” fields. This is an optional field for new items defined by the customer.

29 Alarm Definitions “text” “setEventID” “clearEventID”
This is the text that gets sent to the host in the S5F1 message. “setEventID” This collection event ID (CEID) gets triggered when the alarm changes to the SET state (active). “clearEventID” This collection event ID (CEID) gets triggered when the alarm changes to the CLEAR state(inactive). Each alarm CEID must be unique and defined before the alarm definition in the EPJ file

30 EPJ Project File Modification Techniques
Here are some options for editing the content of the EPJ file: Manually using a text editor. You can usually organize your project better when done manually. Write a program to generate the file. You may want to do this if you prefer defining your items somewhere other than an epj file (like a database or an xml file). Using CIMConnect Control Panel (not recommended). You will lose your comments, and it may rearrange your items. Using the CIMConnect API (ICxClientTool interface)

31 Creating the link between CIMConnect and your system.
3. Project Programming Creating the link between CIMConnect and your system.

32 Programming Tasks Using COM with CIMConnect
Design a Processing State Model for your equipment Initialize CIMConnect Start EMService Connect your application Load the project file if needed Register for callback functions Setup and implement callback functions Getting and Setting variable values Equipment Constant verification Process Program Management (optional) Remote Commands (optional) Terminal Services (optional) Shutdown EMService

33 CIMConnect COM Interfaces
ICxEMService ICxClientApplication ICxClientTool ICxHostEmulator Application Callbacks ICxEMAppCallback, ICxEMAppCallback2, ICxEMAppCallback3 and ICxEMMsgCallback ICxValueDisp and ICxValue SECS-II data value

34 CCxEMService COM Object
ICxEMService Initializes EMService Query ICxClientApplication List of Equipment List of Applications Shutdown EMService Required during equipment shutdown

35 CCxClientClerk COM Object
ICxClientApplication Handle variables, events, alarms, state machines ICxClientTool Manage EPJ file Manage variable, event, alarm definitions ICxHostEmulator Simulate GEM host Reports, traces, limits, commands

36 CCxValueObject COM Object
ICxValueDisp Most common Visual Basic Limited data types ICxValue Complete data types Enhanced array handling

37 ICxEMAppCallback COM Interface
Must be implemented by the user’s client application Remote commands Monitor EMService Process programs Terminal services Variable values on-demand

38 Tips For Using COM in C/C++
Import EMService into your project. This makes the COM interfaces available. Similar to including header files: #import "EMService.exe" raw_interfaces_only, raw_native_types, no_namespace, named_guids exclude("ICxValueDisp", "ValueType", "CompareValueOp", "IID_ICxValueDisp") #import "CxValue.dll" raw_interfaces_only, raw_native_types, no_namespace, named_guids It’s common to place these #import statements in StdAfx.h, although they could be placed somewhere else as well Avoid importing in multiple locations. If more than one location, then a compiler redefinition error will occur for the imported types.

39 Tips For Using COM in C/C++ (cont.)
Component’s lifetime is managed using reference counting Using interfaces pointers, the programmer is required to manage the reference count of a component using AddRef() and Release() Smart pointers manage the reference count for the programmer and are much easier to use. A smart pointer can be identified by the “Ptr” at the end of the type name: ICxEMService* ems; - This is a raw interface pointer ICxEMServicePtr ems; - This is a smart pointer Smart pointers aren’t real pointers at all, but objects that encapsulate the real pointer. They behave very much like the actual pointers do… but add additional functionality.

40 Tips For Using COM in C/C++ (cont.)
To create an component, you use the Class ID for the component. Here is how you would create a CxEMService component and get the ICxEMService interface: ICxEMServicePtr ems; // The internal pointer is NULL at this point ems.CreateInstance(CLSID_CxEMService); This should work as well: ICxEMServicePtr ems(CLSID_CxEMService); Here is how it would look if regular pointers were used: ICxEMService* ems = NULL; CoCreateInstance(CLSID_CxEMService, NULL, CLSCTX_INPROC_SERVER, IID_ICxEMService, (void**)&ems);

41 Tips For Using COM in C/C++ (cont.)
A single component may provide several interfaces. If you have one interface, you can get any of the other interfaces. Using Smart pointers: // clientApp is an ICxClientApplicationPtr ICxClientToolPtr clientTool = clientApp; Or: ICxClientToolPtr clientTool(clientApp); Using regular pointers: ICxClientTool* clientTool = NULL; clientApp->QueryInterface(IID_ICxClientTool, (void**)&clientTool);

42 Tips For Using COM in C# Import EMService into your project to COM interfaces available Add COM libraries to the References folder Add “using” statements: using EMSERVICELib; using VALUELib;

43 Tips For Using COM in C# (cont.)
Component’s lifetime is managed by the C# Garbage Collector Reference count is managed by the C# Garbage Collector To create a component, you use new like creating any other C# class: CxEMService emService = new CxEMService(); A single component may provide several interfaces. If you have one interface, you can get any of the other interfaces. Examples: using the as keyword: // m_clientClerk is an ICxClientTool ICxClientTool m_clientTool = m_clientClerk as ICxClientTool; or C-style cast (not-recommended): ICxClientTool m_clientTool = (ICxClientTool )m_clientClerk;

44 Processing State Model
A Harel notation processing state model diagram Transition table State definitions Follow GEM style in coordination with the remote commands Customize the model to your equipment

45 Processing State Model (Expected Nature Only)

46 Processing State Model (cont.)
The equipment application must manage the processing state machine. This is the only GEM state machine that isn’t managed by CIMConnect. Enumerations should be defined in the application for each state: enum ProcState { IDLE, SETUP, READY, EXECUTING, PAUSE }; Collection events should be defined in the EPJ project file for the state transitions: 3232=IdleToSetup,Processing State changed from IDLE to SETUP,

47 Processing State Model (cont.)
When the processing state changes, call the ProcessingStateChange function: C++ clientApp->ProcessingStateChange( SETUP, CComBSTR(“Setup”), 3232, CComBSTR(“”)); C# string newState = "Setup"; string eventName = "PSInitToSetup"; clientApp.ProcessingStateChange( SETUP, ref newState, 3232, ref eventName); When this function is used, the GEM variables PreviousProcessState, ProcessState, and ProcessStateString are updated. If the optional event is provided (3232), then that event will be triggered by CIMConnect after updating the variables.

48 Processing State Model (cont.)
The equipment application may optionally register to handle GEM state changes: C++ clientApp->RegisterStateMachineHandler(0, appCallback) C# clientApp.RegisterStateMachineHandler(0, appCallback) When registered, the StateChange callback function will be called: C++ HRESULT CIMConnectCallbacks::StateChange(long connID, StateMachine machine, long state) public void StateChange(int connectionID, StateMachine machine, int state) The machine parameter will be set equal to smProcess The state parameter will be set equal to the value used in the ProcessingStateChange function call

49 Initialize CIMConnect
See the InitializeCIMConnect () function in the CIMConnectSampleApp example application. This is pretty typical for most applications.

50 Implement Callback COM Interface in C++
The instructions in this section are for Visual C++ 6.0 In the “ClassView” tab, right mouse click on the project name and select the menu item “New ATL Object…”. An error message might pop up the first time… try again. In the “ATL Object Wizard” dialog that appears, select the “Simple Object” icon, and click the “Next>” button. Fill in the short name field with a name that describes what the class does (Such as “CIMConnectCallbacks”). All of the other fields will be filled in for you. Click OK when done. After clicking OK in the “ATL Object Wizard” dialog, a new class should appear under the project in the “ClassView” window (although Visual Studio sometimes fails to display it).

51 Implement Callback COM Interface in C++ (cont.)
In the “ClassView” tab, right mouse click on the new class “CCIMConnectCallbacks”, and select the menu item “Implement Interface…”. The “Implement Interface” dialog should appear. In the “Implement Interface” dialog, click on the “Add Typelib…” button to display the “Browse Type Libraries” dialog. In the “Browse Type Libraries” dialog, place a check mark next to the item “Cimetrix EMService 1.0 Type Library(1.0)” and click the OK button. After clicking OK, the interfaces available in EMService will be displayed in the “Implement Interface” dialog. Place a check mark next to any of the following callback interfaces you are interested in implementing and click the OK button when ready: ICxEMAppCallback ICxEMAppCallback2 ICxEMAppCallback3 ICxEMMsgCallback

52 Implement Callback COM Interface in C++ (cont.)
After clicking OK, the callback methods will be added to the “CCIMConnectCallbacks” class. The functions are currently unimplemented and return HRESULT values of E_NOTIMPL. Add your implementation code to the callback methods you are interested in handling and return a different HRESULT value (S_OK). Your new callback component “CCIMConnectCallbacks” now includes interfaces for the callbacks plus an empty interface called “ICIMConnectCallbacks”. It is often necessary to add methods to this interface to initialize your new component. To add a new method to this interface, right click on the interface name under the component, and select the menu item “Add Method…”. The “Add Method to Interface” dialog will appear.

53 Implement Callback COM Interface in C++ (cont.)
In the “Add Method to Interface” dialog, fill in the method name (for example, “Init”). Add any parameters to the method and click OK when finished. The new method should appear under the interface name in the “ClassView” tab. It is now ready to edit just like any other function. To define a smart pointer for your new callback interface, you could place the following macro after the “CCIMConnectCallbacks” class definition in the header file: _COM_SMARTPTR_TYPEDEF(ICIMConnectCallbacks, __uuidof(ICIMConnectCallbacks)); This macro defines a new type called “ICIMConnectCallbacksPtr” that you can use in your project.

54 Implement Callback COM Interface in C++ (cont.)
Add a member variable of type “ICIMConnectCallbackPtr” in one of the application classes: private: ICIMConnectCallbacksPtr m_pCallbacks; Create an instance during initialization: HRESULT hr; hr = m_pCallbacks.CreateInstance (CLSID_CIMConnectCallbacks); Call the Init() method on the interface (use -> notation): m_pCallbacks->Init((LONG)this);

55 Implement Callback COM Interface in C++ (cont.)
Register to handle callback methods with an object of type ICxEMApplicationPtr that has been created earlier: ICxEMAppCallbackPtr pCB = m_pCallbacks; m_pClientApp->RegisterStateMachineHandler(1, pCB);

56 Implement Callback COM Interface in C#
The instructions in this section are for Visual Studio 2008: In the Solution Explorer tab right click on the References folder and select Add Reference..., it may take several seconds for the window to display Click the COM tab, it may take several seconds for the tab to display Scroll down to Cimetrx EMService 1.0 Type Library and click on it Scroll down a little more until you see Cimetrix Value 1.0 Type Library, hold down the Ctrl button while clicking Cimetrix Value 1.0 Type Library (both selections should now be highlighted) Click OK

57 Implement Callback COM Interface in C# (cont.)
Add these using statements to your C# source code: using System.Runtime.InteropServices; using EMSERVICELib; using VALUELib; Add a class to your C# source code that implements the callback interfaces, like this: public class CIMConnectCallbacks : ICxEMAppCallback,ICxEMAppCallback2,ICxEMAppCallback3,ICxEMMsgCallback { } Add a constructor that takes a single parameter of the type of your application class, like this: public CIMConnectCallbacks(Form1 frmRef) m_formRef = frmRef; Add a member variable to the callback class of the type of your application class, like this: Form1 m_formRef;

58 Implement Callback COM Interface in C# (cont.)
Click on the callback interface named ICxEMAppCallback, and then type Alt-Shift-F10. This will bring up a popup menu with two options, select “Implement interface ‘ICxEMAppCallback’” Visual Studio 2008 will stub all of the callback methods for this interface Repeat this process for the remaining three callback interfaces, namely, ICxEMAppCallback2, ICxEMAppCallback3, and ICxEMMsgCallback The callback methods are currently unimplemented and throw the following exception: throw new NotImplementedException(); Add your implementation code to the callback methods you are interested in handling and remove the code that throws the exception

59 Implement Callback COM Interface in C# (cont.)
Add a member variable of type “CIMConnectCallbacks” in your application class: private CIMConnectCallbacks m_cimConnectCallbacks; Create an instance during initialization: m_cimConnectCallbacks = new CIMConnectCallbacks(this);

60 Implement Callback COM Interface in C# (cont.)
Register to handle callback methods with an object that implements the ICxEMApplication interface which was created earlier: m_clientApplication.RegisterStateMachineHandler(1, m_cimConnectCallbacks);

61 Important Guidelines About Callbacks
Do not spend much time executing code within a callback function. Return quickly. If the GUI needs to be updated in response to a callback: use PostMessage(…) in C++ use delegates in C# rather than accessing the controls directly from within the callback. To do this, you will likely need to provide a reference to your application class to the callback class: add an Init() to pass the application window into your COM callback interface in C++ define a constructor that takes your application class type as a parameter Calling certain CIMConnect functions from within a callback method might not work. Make sure to test any function calls back to CIMConnect. Use the Global Interface Table to use CIMConnect interfaces from within callback methods. COM components should not be used directly outside of the thread that they were created in. Some callbacks can only be registered once

62 CIMConnect Callbacks CommandCalled GetValue StateChanged
TerminalMsgRcvd VerifyValue ValueChanged MessageReceived HostTermMsgAck CallbackReplaced AlarmChanged EventTriggered HostPPLoadingAck HostPPSendAck PPData PPDataFile PPDelete PPDRequest PPLoadInquire PPSend PPSendFile PPRequest

63 Trigger Collection Event
ICxClientApplication TriggerEvent AsyncTriggerEvent C++ BSTR name = L”MyEvent”; long id = -1; HRESULT hr = m_pCxClientApplication->TriggerEvent( 0, &id, &name ); C# string name = ”MyEvent”; int id = -1; m_pCxClientApplication.TriggerEvent( 0, ref id, ref name );

64 Variable Value Management
CIMConnect manages the storage and retrieval of variable values automatically. For each Status Variable, using one of the following methods to handle the data SetValue Function GetValue Callback

65 Set by Application

66 SetValue API Family Cache one variable value at a time
SetValueFromByteBuffer() Cache multiple variable values at once SetValues() SetValuesFromByteBuffer SetWellKnownValue Update using the well-known name SetValuesTriggerEvent Update multiple values and trigger the event Guarantee DV/CE association

67 Set Variable Value Setting a status variable value example: C++
CComBSTR bstrVal(“U1 1”); CComBSTR bstrName(“MyVariable”); ICxValueDispPtr value(CLSID_CxValueObject); long id = -1; VariableResults myResults; value->RestoreFromString(0, 0, bstrVal ); hr = m_pClientApp->SetValue( 1, SV, &id, &bstrName, value, &myresults ); C# string val = “U1 1”; string name = “MyVariable”; CxValueObject value = new CxValueObject(); int id = -1; VariableResults results; m_pClientApp.SetValue(1, VarType.SV, ref id, ref name, value, out results);

68 Value Retrieval (GetValue)

69 GetValue Callback Family
RegisterGetValueHandler GetValueToByteBuffer RegisterGetValueToByteBufferHandler GetValues RegisterGetValues2Handler (a Boolean parameter set to false indicates to CIMConnect to not use a byte buffer) GetValuesToByteBuffer RegisterGetValues2Handler (a Boolean parameter set to true indicates to CIMConnect to use a byte buffer)

70 Value Retrieval For some variables, you may want the storage of the value to be managed somewhere else, but would still like to the CIMConect functions to behave like normal: Analog device (temperature, pressure, etc.) database Shared memory If a variable has registered using RegisterGetValueHandler(), then the GetValue callback (not the same as the GetValue function) will be called whenever CIMConnect needs to know the value of the variable: During collection event report generation When one of the GetValue API functions is used in your application When the host requests a value

71 ICxValue, ICxValueDisp
Value Storage Any SECS-II Data Type and Value ::RestoreFromString ::CopyToString Data Type Specific SetValueF8, SetValueU4 Copy to/from XML

72 Value Object: Simple Types
::SetValueU4 ::SetValueF8 ::SetValueASCII ::GetValueU4 ::GetValueF8 ::GetValueASCII

73 Value Object: Null

74 Value Object: Array Types

75 Value Object: Simple List

76 Value Object: Complex List

77

78 Setting Alarms Use the SetAlarm() API function to change an alarm state to the SET state: C++ long alid = -1; CComBSTR name(”Alarm10”); hr = m_pClientApp->SetAlarm( alid, &name ); C# int alid = -1; string name = ”Alarm10”; m_pClientApp.SetAlarm(ref alid, ref name); When the alarm is set, CIMConnect will automatically: Update the AlarmsSet status variable (list of set alarms) Update the ASer status variable (alarm change count) Update the AlarmState status variable (state of last change) Send the S5F1 alarm notification to the host if enabled Send the S6F11 SET event notification to the host if enabled Call the AlarmChanged() callback on interfaces that have registered using RegisterAlarmChanged()

79 Clearing Alarms Use the ClearAlarm() API function to change an alarm state to the CLEAR state: C++ long alid = -1; CComBSTR name(”Alarm10”); hr = m_pClientApp->ClearAlarm( alid, &name ); C# int alid = -1; string name = ”Alarm10”; m_pClientApp. ClearAlarm(ref alid, ref name); When the alarm is cleared, CIMConnect will automatically: Update the AlarmsSet status variable (list of set alarms) Update the ASer status variable (alarm change count) Update the AlarmState status variable (state of last change) Send the S5F1 alarm notification to the host if enabled Send the S6F11 SET event notification to the host if enabled Call the AlarmChanged() callback on interfaces that have registered using RegisterAlarmChanged()

80 Equipment Constant Verification
When an equipment constant value is changed, your application should verify that the value is good and that the equipment is a state where the value can be changed. RegisterVerifyValueHandler() API function VerifyValue() callback can be used to send the result back to host: vvVerified = 0 vvNoVariable = 1 = Variable does not exist vvBusy = 2 = Can not verify right now vvOutOfRange = 3 = Value is out of range

81 Process Program Management
By File, using PP callbacks As Data, using PP callbacks As Custom Messages

82 Connection ID Parameter
Used by many API functions, particularly in the ICxClientApplication interface Identifies either one host or all hosts A host is a connection 0 applies all hosts (connections) >0 applies to a specific host (connection)

83 Equipment Constants Get the value as needed Minimum & Maximum
ICxClientApplication::GetValue Minimum & Maximum Out of range rejected automatically VerifyValue callback ValueChanged callback

84 Processing State Machine
ICxClientApplication::ProcessingStateChange New state C++ long new_state; BSTR* new_state_name; C# int new_state; string new_state_name; Transition event, name or ID long transition_ceid; BSTR* transition_cename; int transition_ceid; string transition_cename;

85 SECS-II Message Handling
Send SECS-II Messages ICxClientApplication::SendMessage Asynchronous ICxClientApplication:: SyncSendMessage Synchronous Received SECS-II Messages ICxEMAppCallback::MessageReceived Send Reply Intercept Standard CIMConnect Messages

86 Event Data Synchronization Queue
TriggerEvent returns after Event Report gathering Set DV values then trigger event, in a queue Ensures DV/CE synchronization

87 Adding features to your system’s user interface.

88 System Requirements System User Interface Communication Setup
System Reset

89 System User Interface State Model Status State Model Control
Terminal Service Interaction Process Program Tools Communication Setup

90 State Model Status Communication State (CommState)
Control State (ControlState) Terminal Service Reception Spooling (optional) API or ActiveX Control

91 State Model Control Communication enable/disable
Control on-line/off-line & local/remote GEM equipment constants User defined equipment constants Spool enable/disable API or ActiveX Control

92 ICxClientApplication State Machine
EnableComm EnableSpooling GoOnline GoRemote SetWellKnownValue SetValue DisableComm DisableSpooling GoOffline GoLocal GetWellKnownValue GetValue

93 Terminal Service Interaction
View one incoming message Create outgoing message Acknowledge incoming message API or ActiveX Control

94 Terminal Service Features
ICxClientApplication TriggerWellKnownEvent SendTerminalMsg ICxEMAppCallback TerminalMsgRcvd HostTermMsgAcknowledge Terminal Service ActiveXControl

95 Process Program Tools Display list Create/edit/view/delete
Upload to host Download from host Display current name Select process program API or ActiveX Control

96 Process Program Features
ICxClientApplication PPLoadInquire PPRequest PPSend ICxEMAppCallback

97 Alarm ActiveX Controls
Alarm History Alarm States

98 SECS-II Message Log ActiveX
SML Format Save to file

99 Communication Settings ActiveX
Creates Communication Settings String HSMS or SECS-I

100 Equipment Constants ActiveX
Set EC values View EC values

101 Create an interface manual for your SEMI equipment

102 GEM Interface Manual GEM compliance statement GEM state models
Remote commands Processing State Model SECS-II message scenarios SECS-II message formats Document all Data Variables, Status Variables, Equipment Constants, Collection Events, and Alarms

103 MS Word™ Template Combines style of multiple manuals
Developer comments Add Processing State Model Definitions Appendix information

104 CIMConnect Diagnostics

105 Enable Diagnostics EPJ File CIMConnect Control Panel Registry
NSL Files Created Recycle files Time or Files Sizes Default Directory C:\CIMConnectProjects\Equipment1\Logging

106 Notification Spy (NSL Reader)
Read NSL File SECS-II Messages CIMConnect Diagnostics

107 NSL to SML SECS-II Messages Only
:39:51:690 e: 0 c: 1 TID: H->E S1,F13 L,0 :39:51:690 e: 0 c: 1 TID: H<-E S1,F14 L,2 Bi 0 A GA2130 A V2.50

108 CIMConnect Control Panel

109 Reporting Issues Support Tool EPJ File
System Data SendToCimetrix<Date>.html EPJ File Instructions to reproduce issue at Cimetrix Source code (if applicable)


Download ppt "Cimetrix CIMConnect Training"

Similar presentations


Ads by Google