Applies To:
  • CitectSCADA 5.30

How can I create an ActiveX object with Visual Basic that can be used in Citect? 

The following is a basic guideline for creating ActiveX objects in VB:

To create an ActiveX object in Visual Basic first create a new project of type ActiveX Control. Name the Project and User Control created, then place on the user control the type of object required (eg. a ComboBox). Set any properties you want to remain set, and write any methods you want to use. Keep in mind at this point that Citect will not write to properties that require more than one argument (eg Column(0,1)), so for these properties you will have to write a method (Citect will support multiple arguments for methods) that writes to these properties. Have a look at the project properties (under the Project menu) and on the Component tab select Binary project compatibility. Save the project.

The next step is to run the ActiveX control interface wizard. This can be found under the Add-Ins menu. (If you cannot see this option under the menu, then you will first have to load the wizard using the Add-In Manager found under the Add-Ins menu). This wizard will allow you to make public any of the properties and methods used on your user control. Making properties and methods public means that you will be able to read or write to them from an external application (eg Citect). Save the project again.

Now you are ready to make the ActiveX object. Under the File menu select the Make <project name>.ocx option. This will create your object for you. You then need to publish the object (this registers the object), which can be done by selecting Publish under the Tools menu. In Citect you should now be able to select the ActiveX object tool in Graphics Builder and paste the object onto your Citect page.