irioCoreCpp Library Module
2.1.0
|
Class managing the resources used for IMAQ DAQ operations. More...
#include <terminalsDMAIMAQ.h>
Public Member Functions | |
TerminalsDMAIMAQ (std::shared_ptr< TerminalsDMAIMAQImpl > impl) | |
Manages finding IMAQ resources. More... | |
void | configCameraLink (const std::int32_t fvalHigh, const std::int32_t lvalHigh, const std::int32_t dvalHigh, const std::int32_t spareHigh, const std::int32_t controlEnable, const std::int32_t linescan, const CLSignalMapping &signalMapping, const CLMode &mode) const |
Configure CameraLink frame grabber. More... | |
size_t | readImageNonBlocking (const std::uint32_t n, const size_t imagePixelSize, std::uint64_t *imageRead) const |
Tries to read an specifeid number of pixels. More... | |
size_t | readImageBlocking (const std::uint32_t n, const size_t imagePixelSize, std::uint64_t *imageRead, const std::uint32_t timeout=0) const |
Waits to read an specified number of pixels from a DMA group. More... | |
size_t | readImage (const std::uint32_t n, const size_t imagePixelSize, std::uint64_t *imageRead, const bool blockRead, const std::uint32_t timeout=0) const |
Reads an specified number of pixels from a DMA group. More... | |
void | sendUARTMsg (const std::vector< std::uint8_t > &msg, const std::uint32_t timeout=0) const |
Sends an UART message to the CameraLink system. More... | |
std::vector< std::uint8_t > | recvUARTMsg (const size_t bytesToRecv=0, const std::uint32_t timeout=1000) const |
Reads an UART message from the CameraLink system. More... | |
void | setUARTBaudRate (const UARTBaudRates &baudRate, const std::uint32_t timeout=0) const |
Sets UART baud rate. More... | |
UARTBaudRates | getUARTBaudRate () const |
Read UART baud rate. More... | |
std::uint16_t | getUARTBreakIndicator () const |
Read UART Break Indicator. More... | |
std::uint16_t | getUARTFramingError () const |
Read UART Framing Error. More... | |
std::uint16_t | getUARTOverrunError () const |
Read UART Overrun Error. More... | |
Public Member Functions inherited from irio::TerminalsDMACommon | |
TerminalsDMACommon (std::shared_ptr< TerminalsDMACommonImpl > impl) | |
Manages finding DMA resources common to all terminals that use them, DAQ/IMAQ. More... | |
std::uint16_t | getNCh (const std::uint32_t n) const |
Returns number of channels in specific DMA. More... | |
bool | getDMAOverflow (const std::uint16_t n) const |
Returns the FPGA DMA Overflow register of a specific DMA. More... | |
std::uint16_t | getAllDMAOverflows () const |
Returns the FPGA DMA Overflow register. More... | |
FrameType | getFrameType (const std::uint32_t n) const |
Return the type of frame used in a specific DMA. More... | |
std::vector< FrameType > | getAllFrameType () const |
Returns a vector of the frame types used by each DMA in the FPGA. More... | |
std::uint8_t | getSampleSize (const std::uint32_t n) const |
Returns the sample size of each data for a specific DMA. More... | |
std::vector< std::uint8_t > | getAllSampleSizes () const |
Returns a vector of sample sizes used by each DMA in the FPGA. More... | |
void | startDMA (const std::uint32_t n) const |
Configure a specified DMA, start it and clean its contents. More... | |
void | startAllDMAs () const |
Configures and starts all DMAs in the FPGA. More... | |
void | stopDMA (const std::uint32_t n) const |
Stops the specified DMA group. More... | |
void | stopAllDMAs () const |
Stops all DMAs in the FPGA. More... | |
void | cleanDMA (const std::uint32_t n) const |
Cleans the contents of a specified DMA group. More... | |
void | cleanAllDMAs () const |
Cleans the contents of all DMAs in the FPGA. More... | |
bool | isDMAEnable (const std::uint32_t n) const |
Returns if a DMA group is enabled or not. More... | |
void | enableDMA (const std::uint32_t n) const |
Enables a DMA group. More... | |
void | disableDMA (const std::uint32_t n) const |
Disables a DMA group. More... | |
void | enaDisDMA (const std::uint32_t n, bool enaDis) const |
Enables or disables a DMA group. More... | |
size_t | readDataNonBlocking (const std::uint32_t n, const size_t elementsToRead, std::uint64_t *data) const |
Tries to read an specified number of elements from a DMA group. More... | |
size_t | readDataBlocking (const std::uint32_t n, const size_t elementsToRead, std::uint64_t *data, const std::uint32_t timeout=0) const |
Waits to read an specified number of elements from a DMA group. More... | |
size_t | readData (const std::uint32_t n, const size_t elementsToRead, std::uint64_t *data, const bool blockRead, const std::uint32_t timeout=0) const |
Reads an specified number of elements from a DMA group. More... | |
size_t | countDMAs () const |
Returns the number of DMAs found. More... | |
Public Member Functions inherited from irio::TerminalsBase | |
TerminalsBase (std::shared_ptr< TerminalsBaseImpl > impl) | |
Base class used for terminals. More... | |
Additional Inherited Members | |
Protected Attributes inherited from irio::TerminalsBase | |
std::shared_ptr< TerminalsBaseImpl > | m_impl |
Smart pointer with the terminal implementation. | |
Class managing the resources used for IMAQ DAQ operations.
Definition at line 17 of file terminalsDMAIMAQ.h.
|
explicit |
Manages finding IMAQ resources.
irio::errors::NiFpgaError | Error reading resources from the FPGA |
impl | Shared pointer to a class implementing the functionality |
void irio::TerminalsDMAIMAQ::configCameraLink | ( | const std::int32_t | fvalHigh, |
const std::int32_t | lvalHigh, | ||
const std::int32_t | dvalHigh, | ||
const std::int32_t | spareHigh, | ||
const std::int32_t | controlEnable, | ||
const std::int32_t | linescan, | ||
const CLSignalMapping & | signalMapping, | ||
const CLMode & | mode | ||
) | const |
Configure CameraLink frame grabber.
Configure CameraLink frame grabber with the camera parameters. This configuration includes:
This configuration must be done before running the FPGA.
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
fvalHigh | 0=FVAL active low 1=FVAL active high |
lvalHigh | 0=LVAL active low 1=LVAL active high |
dvalHigh | 0=DVAL active low 1=DVAL active high |
spareHigh | 0=SPARE active low 1=SPARE active high |
controlEnable | 0=High impedance on conrol signals 1=Control signals driver by the FPGA. |
linescan | 0=Regular scan (complete image) 1=Line scan |
signalMapping | Signal map to be used. |
mode | Configuration to be used. |
UARTBaudRates irio::TerminalsDMAIMAQ::getUARTBaudRate | ( | ) | const |
Read UART baud rate.
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
irio::errors::CLUARTInvalidBaudRate | The baud rate read from the FPGA does nto match any of the expected values |
std::uint16_t irio::TerminalsDMAIMAQ::getUARTBreakIndicator | ( | ) | const |
Read UART Break Indicator.
Reads the value from CameraLink UART break indicator port. A non-zero value returned indicates an interruption in the UART communication.
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
std::uint16_t irio::TerminalsDMAIMAQ::getUARTFramingError | ( | ) | const |
Read UART Framing Error.
Reads the value from CameraLink UART framing error port. A non-zero value returned indicates problems while receiving UART data.
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
std::uint16_t irio::TerminalsDMAIMAQ::getUARTOverrunError | ( | ) | const |
Read UART Overrun Error.
Reads the value from CameraLink UART overrun error port. A non-zero value returned indicates an overrun in a UART buffer, causing data loss.
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
size_t irio::TerminalsDMAIMAQ::readImage | ( | const std::uint32_t | n, |
const size_t | imagePixelSize, | ||
std::uint64_t * | imageRead, | ||
const bool | blockRead, | ||
const std::uint32_t | timeout = 0 |
||
) | const |
Reads an specified number of pixels from a DMA group.
It can be configure to wait until there are the specified number of pixels in the DMA or read nothing if there are not enough. If configured to wait, a timeout can be specified.
irio::errors::ResourceNotFoundError | Resource specified not found |
irio::errors::DMAReadTimeout | If reading is in blocking mode, and the timeout expires waiting for enough data to be read |
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
n | Number of DMA group |
imagePixelSize | Number of pixels to read from the DMA |
imageRead | Buffer to write the read image. Allocation and deallocation of this buffer is user responsibility |
blockRead | Whether to wait until the requested number of pixels ( imagePixelSize ) are available or not |
timeout | If blockRead is true. Max time in milliseconds to wait for the imagePixelSize to be available, 0 means wait indefinitely. If blockRead is false, this parameter is ignored. |
imagePixelSize
it they were. size_t irio::TerminalsDMAIMAQ::readImageBlocking | ( | const std::uint32_t | n, |
const size_t | imagePixelSize, | ||
std::uint64_t * | imageRead, | ||
const std::uint32_t | timeout = 0 |
||
) | const |
Waits to read an specified number of pixels from a DMA group.
The read operation will block until the requested number of elements are available or a timeout expires if specified.
irio::errors::ResourceNotFoundError | Resource specified not found |
irio::errors::DMAReadTimeout | If reading is in blocking mode, and the timeout expires waiting for enough data to be read |
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
n | Number of DMA group |
imagePixelSize | Number of pixels to read from the DMA |
imageRead | Buffer to write the read image. Allocation and deallocation of this buffer is user responsibility |
timeout | Max time in milliseconds to wait for the elementsToRead to be available, 0 to wait indefinitely. |
elementsToRead
size_t irio::TerminalsDMAIMAQ::readImageNonBlocking | ( | const std::uint32_t | n, |
const size_t | imagePixelSize, | ||
std::uint64_t * | imageRead | ||
) | const |
Tries to read an specifeid number of pixels.
If there are less pixels than requested available, nothing is read.
irio::errors::ResourceNotFoundError | Resource specified not found |
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
n | Number of DMA group where image is stored |
imagePixelSize | Size of the image in pixels |
imageRead | Buffer to write the read data. Allocation and deallocation of data is user responsibility |
elementsToRead
it they were. std::vector<std::uint8_t> irio::TerminalsDMAIMAQ::recvUARTMsg | ( | const size_t | bytesToRecv = 0 , |
const std::uint32_t | timeout = 1000 |
||
) | const |
Reads an UART message from the CameraLink system.
Do not use bytesToRecv = 0 and timeout = 0 at the same time!
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
bytesToRecv | Number of bytes to read. If it is 0, reads everything until timeout |
timeout | Max time (ms) to wait between bytes. (0 to wait indefinetly) |
void irio::TerminalsDMAIMAQ::sendUARTMsg | ( | const std::vector< std::uint8_t > & | msg, |
const std::uint32_t | timeout = 0 |
||
) | const |
Sends an UART message to the CameraLink system.
Streams the given vector to the CameraLink camera connected to the frame grabber.
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
irio::errors::CLUARTTimeout | Timeout waiting for TERMINAL_UARTTXREADY to be ready |
msg | Message to send |
timeout | Time in ms to wait for line to be ready to send message. (0 to wait indefinetly) |
void irio::TerminalsDMAIMAQ::setUARTBaudRate | ( | const UARTBaudRates & | baudRate, |
const std::uint32_t | timeout = 0 |
||
) | const |
Sets UART baud rate.
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
irio::errors::CLUARTTimeout | Timeout waiting for TERMINAL_UARTSETBAUDRATE to be ready |
baudRate | Baud rate to configure. |
timeout | Time in ms to wait for the line to be ready (0 to wait indefinetly) |