Skip to content

1. Initialisation

Peter Wegmann edited this page Sep 17, 2024 · 8 revisions

To follow along please refer to dcy06.vi

Initialization of SEC nodes is done sequentially and progresses from top to bottom. A lower level element is always added to the last instantiated element of the higher level. At every level properties can and in some cases have to be added to the last instantiated element.

368165350-c2124cef-c98a-4993-b68a-0e8b5ae737f4

0. Library Initialisation

Before a SEC Node can be constructed, the SHALL library needs to be initialised. The sub-Vi expects:

image

  • DLL Path: The path to the correct folder containing the SHALL DLLs (according to your LabVIEW installation 32bit/64bit)
  • Context_ID: A name for your instantiation context, usually if you only want to instaniate a single SEC node you can use the node id as your Context_ID. Here is more information on the context id.

Out: The only output of Initialise is a cluster containing the DLL path, Context ID and a cleanup mode flag. It is used as input for all subsequent sub-vi calls of SHALL-LabVIEW. The same goes for the error output.

1. Node

After the library is initialised the first node can be instantiated:

image

Input:

  • node id: This is the globally unique identifier of the node. Once the SEC node is running, this id will be accessible as a node property of the name equipment_id.
  • description: This should be a simple description of your device
  • TCP port: A 16-bit integer specifying the network port the node should be accessible at

Note: At this point a arbitrary number of node properties can be added using the following sub-Vis:

image image image image image image

2. Module

Now we add a module to the SEC node.

image

It only expects a module name, which has to be unique for a given Node. But before we can add accessibles to the module there are some mandatory and optional module properties that need to bee added. For this we again use the add property Vis, and choose the most relevant for our datatype:

image image image image image image

interface_classes (mandatory):

This is a very important mandatory module property, specifying functionality of your module. It holds all Interface classes your module supports in the form of a JSON array of strings.

description (mandatory):

The module description is simply a string containing a short description of your module.

pollinterval (optional):

The pollinterval specifies how often all parameters of the module should be polled in seconds.

There are more pre-defined optional module properties, which you can choose from according to your needs. Additionally custom module properties can also be added.

3. Accessibles (Parameters & Commands)

Next we add accessibles to the module. The most efficient way is to construct an array of clusters, containing all information that is needed for each Parameter and then looping through the array.

368179364-2de44728-7bf4-45c6-8d0d-f77af53b8531

Collumns:

  • accessible name: Name of the Parameter/Command

  • type: decides whether a read only parameter, read/write parameter or a command should be added image image image

  • datainfo: typing information for an accessible

  • description: Accessible description

Additional collumns Parameter/Command properties can also be added to the array. For example if finer control over pollintervals on a parameter level is needed.

Note: Once all accessibles have been added to the module, you could jump back to module creation and add another module.

Node Complete

image

Call this sub-vi once you are finished with the creatioin of your node. It will do consistency checks on the node you just created and throw an error if you for example missed adding some mandatory node/module/acessible property.

Furthermore it allows clients to connect to this SEC node.

From here on out you can jump to the next section 2. Main Loop, or add another node.