-
Notifications
You must be signed in to change notification settings - Fork 0
1. Initialisation
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.
Before a SEC Node can be constructed, the SHALL library needs to be initialised. The sub-Vi expects:
-
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 thenode id
as yourContext_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.
After the library is initialised the first node can be instantiated:
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 nameequipment_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:
Now we add a module to the SEC node.
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:
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.
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.
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.
Collumns:
-
accessible name: Name of the Parameter/Command
-
type: decides whether a read only parameter, read/write parameter or a command should be added
-
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.
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.