|
||||||||||||||||
|
KINETICART.LOGIC.USING CHANNELS KineticaRT Channels are all Windows .NET objects designed to hold a value and to allow other objects, including KineticaRT Controls, to connect to them and receive updates to the value as it changes. There are many different types of channels in both the Logic and Server sections of KineticaRT. Using the ChannelsIn a simple system, a channel may be used on its own however many channels are designed to connect to other channels and process the data from those other channels. The KineticaRT expression component is an example. Normally channels will be contained in a channel collection, allowing them to communicate with each other. The KineticaRT.Server component contains a channel collection that can be used for this purpose. An example: Create a new KineticaRT.Server object. Now, whenever the values of the "Volts" and "Amps" channels are set, the expression will re-evaluate itself giving the "Watts" value. If a KineticaRT Dial Control is connected to the "Watts" channel then the dial's needle will also update itself to show the "Watts" value. The "Volts" and "Amps" channels could be replaced by server channels such as OPC Client Items that pick up their data from the OPC Server for a digital multi-meter reading real volts and amps values. Using the Server ObjectThe main purpose of the server object is to hold the channels so that they do not get lost but it also provides the following facilities: FindObjectThe KineticaRT.Server component provides a "FindObject" method. This can be used to find an object in the Children collection by name and is normally used within the ObjectSearch event handler for KineticaRT Controls such as the KineticaRT Frame. It is used within KineticaRT Studio to link the whole application together. ObjectSearchThe KineticaRT Server component contains an ObjectSearch event handler which will handle the ObjectSearch events from all the objects in its Children collection. This allows the expression component in the above example to find the "Volts" and "Amps" channels. Serializable AttributeThe KineticaRT Server component is serializable, allowing you to save your channel configuration and state to file etc. Using Microsoft Visual Studio - Visual Basic or C#Making the control availableBefore a new channel object can be created it is necessary to add the components to your projects references list by right clicking on the project and selecting "Add Reference". The following two files must be added for the above example to work:
Note that most KineticaRT channels will require a design time license before they can be used. In order to use the license, the name and location of the channel component must be added to the "licenses.licx" for the project (found in the projects directory). For example, the expression requires the following line, excluding quotes, to be added to the projects "licenses.licx" file: "KineticaRT.Logic.Expressions.Expression, KineticaRT.Logic.Expressions" |
|
|
||