This class controls DAQ (Data AcQuisition) system. More...
#include <CDAQController.h>
Public Types | |
| enum | EDAQSamplingFlags { daqSampleMax = 0x00 , daqSample1ms = 0x01 , daqSample10ms = 0x02 , daqSample100ms = 0x03 , daqSample1s = 0x04 } |
| This enum defines sampling time constants. More... | |
Public Member Functions | |
| void | attachHW () |
| CDAQController (std::shared_ptr< ConnectionMgr > connectionMgr) | |
| Instantiates object. | |
| DWORD | configAdd (BYTE size, BYTE memArea, uint32_t address, EDAQSamplingFlags sampling=daqSampleMax) |
| DWORD | configAdd (const std::string &symbol, EDAQSamplingFlags sampling=daqSampleMax) |
| void | configReset () |
| iconnect::IntVector | configure (const std::vector< CDAQConfigItem > &rvItems) |
| Configures DAQ with the given items. | |
| iconnect::IntVector | configure (SPDAQConfig spConfig, const std::vector< CDAQConfigItem > &rvItems) |
| Configures DAQ with the given items. | |
| iconnect::IntVector | configure_add (const std::vector< CDAQConfigItem > &rvItems) |
| Adds items to existing configuration. | |
| void | configure_remove (const iconnect::IntVector &rvHandles) |
| Adds items to existing configuration. | |
| void | detachHW () |
| void | enableCore (bool enable) |
| void | enableGlobal (bool enable) |
| Enables or disables DAQ acquisition. | |
| isys::CValueType | getDataValue (const CDAQSample &sample) const |
| Returns the value of the acquired sample in CValueType format. | |
| size_t | getNumItems () |
| CDAQInfo | info () |
| Returns the information about DAQ capabilities. | |
| void | read (std::vector< CDAQSample > &samples, DWORD maxSamples=0) |
| Reads acquired data. | |
| CDAQStatus | status () |
| Returns the current status of the DAQ system. | |
This class controls DAQ (Data AcQuisition) system.
It enables acquisition of data on target in non-blocking mode, but time precision is not as exact as with batch access, which is a blocking call.
Call methods in the following sequence:
attachHW() info() configure() enableGlobal(True) // starts reading vars and placing them in DAQ buffer [status(),] read() // repeat enableGlobal(False) // stops reading vars, but DAQ buffer may contain yet unread data [status(),] Read, // repeat until done detachHW()
Python example: test_attach_detach.py Python example: daq_simple.py
| isys::CDAQController::CDAQController | ( | std::shared_ptr< ConnectionMgr > | connectionMgr | ) |
Instantiates object.
| connectionMgr | class which maintains connection to winIDEA. Connection must be established before this call. |
Python example: test_attach_detach.py Python example: daq_simple.py
| void isys::CDAQController::attachHW | ( | ) |
| DWORD isys::CDAQController::configAdd | ( | BYTE | size, |
| BYTE | memArea, | ||
| uint32_t | address, | ||
| EDAQSamplingFlags | sampling = daqSampleMax ) |
Adds a DAQ item to configuration.
| size | size of the item in bytes |
| memArea | memory area of the item |
| address | address of the item |
| sampling | sampling policy |
Python example: data_recorder_with_daq.py
| DWORD isys::CDAQController::configAdd | ( | const std::string & | symbol, |
| EDAQSamplingFlags | sampling = daqSampleMax ) |
Adds a DAQ item to configuration.
| symbol | name of the variable to monitor |
| sampling | sampling policy |
| void isys::CDAQController::configReset | ( | ) |
Resets DAQ configuration.
Python example: data_recorder_with_daq.py
| iconnect::IntVector isys::CDAQController::configure | ( | const std::vector< CDAQConfigItem > & | rvItems | ) |
Configures DAQ with the given items.
It is not allowed to call configure() when DAQ is enabled (after enableGlobal(true) was called and before enableGlobal(false) was called.)
Python example: test_daq_configure.py
| iconnect::IntVector isys::CDAQController::configure | ( | SPDAQConfig | spConfig, |
| const std::vector< CDAQConfigItem > & | rvItems ) |
Configures DAQ with the given items.
It is not allowed to call configure() when DAQ is enabled (after enableGlobal(true) was called and before enableGlobal(false) was called.)
| spConfig | DAQ configuration |
| rvItems | DAQ items to observe |
Python example: test_daq_configure.py
| iconnect::IntVector isys::CDAQController::configure_add | ( | const std::vector< CDAQConfigItem > & | rvItems | ) |
Adds items to existing configuration.
| rvItems | DAQ items to add to observe |
Python example: test_daq_configure.py
| void isys::CDAQController::configure_remove | ( | const iconnect::IntVector & | rvHandles | ) |
Adds items to existing configuration.
| rvHandles | DAQ item handles (previously obtained via configure of configure_add) to remove from observation |
Python example: test_daq_configure.py
| void isys::CDAQController::detachHW | ( | ) |
| void isys::CDAQController::enableCore | ( | bool | enable | ) |
Enables or disables DAQ acquisition on this particular core. This has to be enabled so that data can be acquired through the DAQ on this particular core.
| enable | defines whether DAQ on the controlled core is enabled or not |
Python example: data_recorder_with_daq.py
| void isys::CDAQController::enableGlobal | ( | bool | enable | ) |
Enables or disables DAQ acquisition.
This has to be enabled so that data can be acquired through the DAQ on any core. Call it after configure() or configAdd() calls.
| enable | defines whether the global DAQ is enabled or not |
Python example: test_attach_detach.py
| isys::CValueType isys::CDAQController::getDataValue | ( | const CDAQSample & | sample | ) | const |
Returns the value of the acquired sample in CValueType format.
If sample configuration was given as address and size (not with symbol name), then unsigned integral type is assumed.
| sample | previously acquired sample. |
Python example: test_run.py
| size_t isys::CDAQController::getNumItems | ( | ) |
Python example: test_daq_configure.py
| CDAQInfo isys::CDAQController::info | ( | ) |
Returns the information about DAQ capabilities.
Python example: test_run.py
| void isys::CDAQController::read | ( | std::vector< CDAQSample > & | samples, |
| DWORD | maxSamples = 0 ) |
Reads acquired data.
| samples | vector where samples will be read to |
| maxSamples | defines the maximum number of samples to read. If 0 is specified, all current acquired samples will be loaded. Not used in SDK versions 9.21.2 and later. |
Python example: test_run.py
| CDAQStatus isys::CDAQController::status | ( | ) |
Returns the current status of the DAQ system.
Python example: test_run.py