winIDEA SDK
|
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
#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. More... | |
DWORD | configAdd (BYTE size, BYTE memArea, ADDRESS address, EDAQSamplingFlags sampling=daqSampleMax) |
DWORD | configAdd (const std::string &symbol, EDAQSamplingFlags sampling=daqSampleMax) |
void | configReset () |
void | configure (const std::vector< CDAQConfigItem > &configItems) |
Configures DAQ with the given items. More... | |
void | detachHW () |
void | enableCore (bool enable) |
void | enableGlobal (bool enable) |
Enables or disables DAQ acquisition. More... | |
isys::CValueType | getDataValue (const CDAQSample &sample) const |
Returns the value of the acquired sample in CValueType format. More... | |
size_t | getNumItems () |
CDAQInfo | info () |
Returns the information about DAQ capabilities. More... | |
void | read (std::vector< CDAQSample > &samples, DWORD maxSamples=0) |
Reads acquired data. More... | |
CDAQStatus | status () |
Returns the current status of the DAQ system. More... | |
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, | ||
ADDRESS | address, | ||
EDAQSamplingFlags | sampling = daqSampleMax |
||
) |
configure()
.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 |
||
) |
configure()
.Adds a DAQ item to configuration.
symbol | name of the variable to monitor |
sampling | sampling policy |
void isys::CDAQController::configReset | ( | ) |
configAdd()
methods, call this method to clear all added samples.Resets DAQ configuration.
Python example: data_recorder_with_daq.py
void isys::CDAQController::configure | ( | const std::vector< CDAQConfigItem > & | configItems | ) |
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
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