winIDEA SDK
isys::CDAQController Class Reference

Description

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>

Inheritance diagram for isys::CDAQController:
isys::WrapperBase

Public Types

enum  EDAQSamplingFlags {
  daqSampleMax = 0x00 , daqSample1ms = 0x01 ,
  daqSample10ms = 0x02 , daqSample100ms = 0x03 ,
  daqSample1s = 0x04
}
 This enum defines sampling time constants. More...
 

Public Member Functions

 CDAQController (std::shared_ptr< ConnectionMgr > connectionMgr)
 Instantiates object. More...
 
void attachHW ()
 
void detachHW ()
 
void configReset ()
 
DWORD configAdd (BYTE size, BYTE memArea, ADDRESS address, EDAQSamplingFlags sampling=daqSampleMax)
 
DWORD configAdd (const std::string &symbol, EDAQSamplingFlags sampling=daqSampleMax)
 
void configure (const std::vector< CDAQConfigItem > &configItems)
 Configures DAQ with the given items. More...
 
size_t getNumItems ()
 
void enableGlobal (bool enable)
 Enables or disables DAQ acquisition. More...
 
void enableCore (bool enable)
 
CDAQInfo info ()
 Returns the information about DAQ capabilities. More...
 
CDAQStatus status ()
 Returns the current status of the DAQ system. More...
 
void read (std::vector< CDAQSample > &samples, DWORD maxSamples=0)
 Reads acquired data. More...
 
isys::CValueType getDataValue (const CDAQSample &sample) const
 Returns the value of the acquired sample in CValueType format. More...
 

Member Enumeration Documentation

◆ EDAQSamplingFlags

This enum defines sampling time constants.

Enumerator
daqSampleMax 

maximum sampling

daqSample1ms 

1ms sampling resolution

daqSample10ms 

10ms sampling resolution

daqSample100ms 

100ms sampling resolution

daqSample1s 

1 s sampling resolution

Constructor & Destructor Documentation

◆ CDAQController()

isys::CDAQController::CDAQController ( std::shared_ptr< ConnectionMgr connectionMgr)

Instantiates object.

Parameters
connectionMgrclass which maintains connection to winIDEA. Connection must be established before this call.

Python example: test_attach_detach.py Python example: daq_simple.py

Member Function Documentation

◆ attachHW()

void isys::CDAQController::attachHW ( )
Deprecated:
this call is no longer required, it does nothing.

◆ configAdd() [1/2]

DWORD isys::CDAQController::configAdd ( BYTE  size,
BYTE  memArea,
ADDRESS  address,
EDAQSamplingFlags  sampling = daqSampleMax 
)
Deprecated:
in 9.21.2, use method configure().

Adds a DAQ item to configuration.

Parameters
sizesize of the item in bytes
memAreamemory area of the item
addressaddress of the item
samplingsampling policy
Returns
the handle/index of the item. This value will be reported in the acquired samples.

Python example: data_recorder_with_daq.py

◆ configAdd() [2/2]

DWORD isys::CDAQController::configAdd ( const std::string &  symbol,
EDAQSamplingFlags  sampling = daqSampleMax 
)
Deprecated:
in 9.21.2, use method configure().

Adds a DAQ item to configuration.

Parameters
symbolname of the variable to monitor
samplingsampling policy
Returns
the handle/index of the item. This value will be reported in the acquired samples.

◆ configReset()

void isys::CDAQController::configReset ( )
Deprecated:
in 9.21.2 and later. If you are still using the deprecated configAdd() methods, call this method to clear all added samples.

Resets DAQ configuration.

Python example: data_recorder_with_daq.py

◆ configure()

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.)

See also
CDAQConfigItem

Python example: test_daq_configure.py

◆ detachHW()

void isys::CDAQController::detachHW ( )
Deprecated:
this call is no longer required, it does nothing.

◆ enableCore()

void isys::CDAQController::enableCore ( bool  enable)
Deprecated:
in 9.21.2 and later this method has no effect. You may remove it from your code.

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.

Parameters
enabledefines whether DAQ on the controlled core is enabled or not

Python example: data_recorder_with_daq.py

◆ enableGlobal()

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.

Parameters
enabledefines whether the global DAQ is enabled or not

Python example: test_attach_detach.py

◆ getDataValue()

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.

Parameters
samplepreviously acquired sample.
Returns
value in CValueType format

Python example: test_run.py

◆ getNumItems()

size_t isys::CDAQController::getNumItems ( )
Returns
currently configured number of DAQ items

Python example: test_daq_configure.py

◆ info()

CDAQInfo isys::CDAQController::info ( )

Returns the information about DAQ capabilities.

Python example: test_run.py

◆ read()

void isys::CDAQController::read ( std::vector< CDAQSample > &  samples,
DWORD  maxSamples = 0 
)

Reads acquired data.

Parameters
samplesvector where samples will be read to
maxSamplesdefines 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.
Returns
the acquired DAQ samples.

Python example: test_run.py

◆ status()

CDAQStatus isys::CDAQController::status ( )

Returns the current status of the DAQ system.

Python example: test_run.py