NDS3  1.0.0
API reference manual
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
NDS3 and EPICS

The command epicsNdsControlSystem is an IOC application that is linked again the NDS framwork and provides the NDS functionalities.

After epicsNdsControlSystem has been launched then the classic EPICS IOC shell will appear: the shell will be able to parse and execute the additional NDS3 commands which will allow to load and run generic NDS3 devices into EPICS.

Getting started

When the EPICS shell appears then you can load one or more NDS3 devices into the shell by using the command ndsLoadDriver.

When the desidered drivers have been loaded then you can instantiate one or more devices by using the command ndsCreateDevice.

The following example loads the so module acquisitionDevice which provide the driver "AcquisitionDevice", then creates 2 acquisition devices named device0 and device1:

$>epicsNdsControlSystem
epics> ndsLoadDriver /usr/bin/acquistionDevice.so
epics> ndsCreateDevice AcquisitionDevice device0
epics> ndsCreateDevice AcquisitionDevice device1
epics> iocInit

You can list the PVs supplied by the 2 devices by issuing the dbl command.

Each device node or PV may provide additional commands that can be executed by using the NDS command nds.

For instance, to switch on a node connected to a state machine:

epics> nds switchOn device0
epics> nds switchOn device0-channel0
epics> nds start device0-channel0

Commands

This section describes the additional IOCSH commands provided by the NDS framework.

ndsLoadDriver

Usage: ndsLoadDriver pathToSoModule

Parameters:

  • pathToSoModule is a path to a shared library that implements an NDS device.

The command loads the shared library in memory and checks that it provides the NDS functionalities. If the loaded module does not export the NDS functions then an error message is displayed.

The device provided by the loaded module can be instantiated with the command ndsCreateDevice.

ndsCreateDevice

usage: ndsLoadDriver driverName rootNodeName [parameter0 [parameter1 [parameter2[ parameter3...]]]]

Parameters:

  • driverName the name of the driver. This is not the shared module name, but the name provided by the shared module's exported function getDeviceName(), which is set by the macro NDS_DEFINE_DRIVER.
  • rootNodeName the parameter to pass as root node name to the device constructor
  • parameterX one or more parameters in the form name=value and passed as named parameters to the device's constructor. Their meaning is device-dependent.

ndsLoadNamingRules

usage: ndsLoadNamingRules pathToNamingRules

Parameters:

If the loaded file contains only one set of rules (just one section) then the rules are enabled immediately, otherwise the command ndsEnableNamingRules must be used to enable one of the rules section.

The file must be loaded before creating the device with ndsCreateDevice.

ndsEnableNamingRules

usage: ndsEnableNamingRulessss rulesSection

Parameters:

  • rulesSection The section in the INI file that contains the naming rules to enable

The command activates the naming rules described in a particular section of a Naming rules definition file.

The rules must be activated before creating the device with ndsCreateDevice.

nds

usage: nds nodeCommand nodeName [parameters]

Parameters:

  • nodeCommand the custom command registered by the node or PV
  • nodeName the name of the node for which the command is being called. Can be the internal or external full node name

The command nds enable the execution of custom commands registered by individual nodes that form the device. Each node can register its own set of commands, but once a command has been registered by a node then the same command registered by other node must accept the same number of parameters as the first registered one.

See nds::Base::defineCommand() for more information about the registration of custom commands.

nds switchOn

usage: nds switchOn nodeName

Parameters:

  • nodeName the node that has to be switched on. Can be the internal or external full node name

This command is automatically provided for all the StateMachine nodes and all the Node objects that have a child StateMachine.

It causes the StateMachine to execute the transition to the state_t::on state.

nds switchOff

usage: nds switchOff nodeName

Parameters:

  • nodeName the node that has to be switched off. Can be the internal or external full node name

This command is automatically provided for all the StateMachine nodes and all the Node objects that have a child StateMachine.

It causes the StateMachine to execute the transition to the state_t::off state.

nds start

usage: nds start nodeName

Parameters:

  • nodeName the node that has to be started. Can be the internal or external full node name

This command is automatically provided for all the StateMachine nodes and all the Node objects that have a child StateMachine.

It causes the StateMachine to execute the transition to the state_t::running state.

nds stop

usage: nds stop nodeName

Parameters:

  • nodeName the node that has to be stopped. Can be the internal or external full node name

This command is automatically provided for all the StateMachine nodes and all the Node objects that have a child StateMachine.

It causes the StateMachine to execute the transition to the state_t::on state.

nds setLogLevelDebug

usage: nds setLogLevelDebug nodeName

Parameters:

  • nodeName the node for which the log level has to be set to debug

This command is automatically provided for all the nodes and PVs (all the Base derived objects).

It enables the debug log level for the node and its children or for the PV.

nds setLogLevelInfo

usage: nds setLogLevelInfo nodeName

Parameters:

  • nodeName the node for which the log level has to be set to info

This command is automatically provided for all the nodes and PVs (all the Base derived objects).

It enables the info debug level for the node and its children or for the PV.

nds setLogLevelWarning

usage: nds setLogLevelWarning nodeName

Parameters:

  • nodeName the node for which the log level has to be set to warning

This command is automatically provided for all the nodes and PVs (all the Base derived objects).

It enables the warning log level for the node and its children or for the PV.

nds setLogLevelError

usage: nds setLogLevelError nodeName

Parameters:

  • nodeName the node for which the log level has to be set to error

This command is automatically provided for all the nodes and PVs (all the Base derived objects).

It enables the error log level for the node and its children or for the PV.

nds subscribe

usage: nds subscribe destinationPVName sourcePVName

Parameters:

  • destinationPVName the output PV to which all the data generated by the input PV sourceNodeName must be sent
  • sourcePVName the input PV from which all the generated data must be passed to destinationPVName

This command connects the inputPV sourcePVName to the output PV destinationPVName: all the data pushed to the inputPV via PVBaseIn::push() or PVVariableIn::setValue() will be written into the output PV via PVBaseOut::write().

The input and output PVs may be part of different NDS devices but must be running into the same process (must be created via ndsCreateDevice in the same IOCSH).

nds replicate

usage: nds replicate destinationPVName sourcePVName

Parameters:

  • destinationPVName the input PV that will push the same data pushed to the input PV sourceNodeName
  • sourcePVName the input PV from which all pushed data will be also pushed to the input PV destinationPVName

This command causes the input PV destinationPVName to replicate all the push operations performed by the input PV sourcePVName.

This command is useful to replicate the results of calculations performed by a NDS device into another NDS device that wants to expose the calculations as its own.

nds decimation

usage: nds decimation inputPVName decimationFactor

Parameters:

  • inputPVName the input PV on which the decimation factor must be changed
  • sourcePVName the new decimation factor

The decimation factor is the ratio of the data pushed to the PV via PVBaseIn::push() versus the data actually pushed to the control system.

Warning
it is not safe to issue this command while the PV is being used for pushing data. The command should be used BEFORE or AFTER the pushing operations on the PV ave been performer.