Software Library API naibrd 1.62
See all documentation at naii.docs.com
|
Functions | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_SetGen (int32_t cardIndex, nai_ether_gen_t etherGen) |
Sets the Ethernet Protocol Generation that should be used to communicate to the board. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_Read (int32_t cardIndex, nai_intf_t intf, uint32_t regwidth, uint32_t address, uint32_t stride, uint32_t count, uint32_t datawidth, void *outdata) |
Ethernet Reads from the board. The data will be truncated if the register is wider than the data width, or padded with zeros if the register is narrower than data width. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_Write (int32_t cardIndex, nai_intf_t intf, uint32_t regwidth, uint32_t address, uint32_t stride, uint32_t count, uint32_t datawidth, void *data) |
Ethernet Writes to the board. The data will be padded with zeros if the register is wider than the data width, or truncated if the register is narrower than the data width. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_ReadFifo (int32_t cardIndex, nai_intf_t intf, uint32_t dataaddr, uint32_t countaddr, uint32_t count, uint32_t *countremaining, uint32_t timeout, uint32_t datawidth, void *data, uint32_t *outread) |
Attempts to read a fifo over a specified interface. If timeout is set to NAIBRD_FIFO_TIMEOUT_NONE, the operation does not block and up to count words are read from the fifo. Otherwise, the operation waits up to timeout milliseconds for the FIFO's count to exceed count before performing the read. If it times out, no data is read. The behavior of this function is not affected by naibrd_SetFifoIOFnc or naibrd_SetMaster. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_SetBlock (int32_t cardIndex, uint16_t blockid, nai_intf_t intf, uint32_t regwidth, uint32_t count, uint32_t address[]) |
Defines the Block Configuration for the Block ID specified. A Block is a list of register addresses to be read or written in a single operation. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_GetBlock (int32_t cardIndex, uint16_t blockid, uint32_t arraysize, uint32_t outaddress[], uint32_t *regcount) |
Retrieves the Block Configuration for the Block ID specified. A Block is a list of register addresses to be read or written in a single operation. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_ClearBlock (int32_t cardIndex, uint16_t blockid) |
Clears the Block Configuration for the Block ID specified. A Block is a list of register addresses to be read or written in a single operation. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_ReadBlock (int32_t cardIndex, uint16_t blockid, uint32_t regwidth, uint32_t arraysize, uint32_t outdata[], uint32_t *datacount) |
Reads the data from the registers defined in the Block Configuration for the Block ID specified. A Block is a list of register addresses to be read or written in a single operation. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_WriteBlock (int32_t cardIndex, uint16_t blockid, uint32_t regwidth, uint32_t count, uint32_t data[]) |
Write data to registers defined in the Block Configuration for the Block ID specified. A Block is a list of register addresses to be read or written in a single operation. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_SetZBlock (int32_t cardIndex, uint16_t blockid, uint32_t regwidth, uint32_t count, uint16_t addrflags[], uint32_t address[]) |
Defines the Z-Block Configuration for the Block ID specified. A Z-Block is a list of register addresses to be read or written in a single operation. Z-Blocks are similar to the regular Block Configuration with a single difference: Z-Blocks may contain on-board and off-board addresses in a single block. The regular Block is restricted to all on-board or all off-board register addresses. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_GetZBlock (int32_t cardIndex, uint16_t blockid, uint32_t arraysize, uint16_t outaddrflags[], uint32_t outaddress[], uint32_t *regcount) |
Retrieves the Z-Block Configuration for the Block ID specified. A Z-Block is a list of register addresses to be read or written in a single operation. Z-Blocks are similar to the regular Block Configuration with a single difference: Z-Blocks may contain on-board and off-board addresses in a single block. The regular Block is restricted to all on-board or all off-board register addresses. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_ClearZBlock (int32_t cardIndex, uint16_t blockid) |
Clears the Z-Block Configuration for the Block ID specified. A Z-Block is a list of register addresses to be read or written in a single operation. Z-Blocks are similar to the regular Block Configuration with a single difference: Z-Blocks may contain on-board and off-board addresses in a single block. The regular Block is restricted to all on-board or all off-board register addresses. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_ReadZBlock (int32_t cardIndex, uint16_t blockid, uint32_t regwidth, uint32_t arraysize, uint32_t outdata[], uint32_t *datacount) |
Reads the data from the registers defined in the Z-Block Configuration for the Block ID specified. A Z-Block is a list of register addresses to be read or written in a single operation. Z-Blocks are similar to the regular Block Configuration with a single difference: Z-Blocks may contain on-board and off-board addresses in a single block. The regular Block is restricted to all on-board or all off-board register addresses. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_WriteZBlock (int32_t cardIndex, uint16_t blockid, uint32_t regwidth, uint32_t count, uint32_t data[]) |
Write data to registers defined in the Z-Block Configuration for the Block ID specified. A Z-Block is a list of register addresses to be read or written in a single operation. Z-Blocks are similar to the regular Block Configuration with a single difference: Z-Blocks may contain on-board and off-board addresses in a single block. The regular Block is restricted to all on-board or all off-board register addresses. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_SetTDRConfig (int32_t cardIndex, uint16_t tdrid, uint16_t protocol, uint16_t iplen, uint8_t ip[], uint16_t port, uint16_t period, uint16_t count, uint32_t arraysize, uint8_t command[]) |
Defines the Time Driven Response Configuration for the TDR ID specified. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_GetTDRConfig (int32_t cardIndex, uint16_t tdrid, uint16_t *outprotocol, uint16_t *outiplen, uint8_t outip[], uint16_t *outport, uint16_t *outperiod, uint16_t *outcount, uint32_t arraysize, uint8_t outcommand[]) |
Retrieves the Time Driven Response Configuration for the TDR ID specified. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_ClearTDRConfig (int32_t cardIndex, uint16_t tdrid) |
Clears the Time Driven Response Configuration for the TDR ID specified. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_StartTDR (int32_t cardIndex, uint16_t tdrid) |
Starts the Time Driven Response for the TDR ID specified. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_StopTDR (int32_t cardIndex, uint16_t tdrid) |
Stops the Time Driven Response for the TDR ID specified. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_SetIDRConfig (int32_t cardIndex, uint16_t idrid, uint16_t protocol, uint16_t iplen, uint8_t ip[], uint16_t port, uint32_t vector, uint16_t count, uint32_t arraysize, uint8_t command[]) |
Defines the Interrupt Driven Response Configuration for the IDR ID specified. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_GetIDRConfig (int32_t cardIndex, uint16_t idrid, uint16_t *outprotocol, uint16_t *outiplen, uint8_t outip[], uint16_t *outport, uint32_t *outvector, uint16_t *outcount, uint32_t arraysize, uint8_t outcommand[]) |
Retrieves the Interrupt Driven Response Configuration for the IDR ID specified. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_ClearIDRConfig (int32_t cardIndex, uint16_t idrid) |
Clears the Interrupt Driven Response Configuration for the IDR ID specified. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_StartIDR (int32_t cardIndex, uint16_t idrid) |
Starts the Interrupt Driven Response for the IDR ID specified. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_StopIDR (int32_t cardIndex, uint16_t idrid) |
Stops the Interrupt Driven Response for the IDR ID specified. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_WriteScript (int32_t cardIndex, uint16_t scriptid, uint16_t cmdcount, uint32_t arraysize, uint8_t command[]) |
Defines the commands for the Script ID specified. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_ReadScript (int32_t cardIndex, uint16_t scriptid, uint16_t *outcount, uint32_t arraysize, uint8_t outcommand[]) |
Retrieves the commands for the Script ID specified. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_ClearScript (int32_t cardIndex, uint16_t scriptid) |
Clears the commands for the Script ID specified. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_RunScript (int32_t cardIndex, uint16_t scriptid, int32_t cmdcount, int32_t dataSz, int32_t *dataLen, uint8_t *data) |
Runs the command for the Script ID specified. Returns any values returned from the script. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_ExecuteScript (int32_t cardIndex, uint16_t scriptid) |
Executes the command for the Script ID specified. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_SetSafeStateScriptId (int32_t cardIndex, uint16_t scriptid) |
Sets the Script ID to be designated as the Safe State Script. The Safe Safe Script is executed when the Safe Safe EtherOpMode Communication Timeout criteria event occurs. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_GetSafeStateScriptId (int32_t cardIndex, uint16_t *outscriptid) |
Retrieves the Script ID to be designated as the Safe State Script. The Safe Safe Script is executed when the Safe Safe EtherOpMode Communication Timeout criteria event occurs. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_NOP (int32_t cardIndex) |
Ethernet NOP Command - This command communicates to the board for connection testing or synchronous idle. Compatible with all generation of boards that support Ethernet. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_SetNoCommsWatchdogTimer (int32_t cardIndex, uint32_t max_sec_between_ether_comm) |
Sets the maximum number of seconds between Ethernet Op Mode communications. Ethernet Op Mode communications refers only to those messages received by the EtherOpMode Listener application on one of the 4 ports (TCP/UDP 52801/52802. Other active Ethernet protocols do not count toward the timeout count. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_GetNoCommsWatchdogTimer (int32_t cardIndex, uint32_t *outmax_sec_between_ether_comm) |
Retrieves the maximum number of seconds between Ethernet Op Mode communications. Ethernet Op Mode communications refers only to those messages received by the EtherOpMode Listener application on one of the 4 ports (TCP/UDP 52801/52802. Other active Ethernet protocols do not count toward the timeout count. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_Write_NoReply (int32_t cardIndex, nai_intf_t intf, uint32_t regwidth, uint32_t address, uint32_t stride, uint32_t count, uint32_t datawidth, void *data) |
Same functionality as the Ethernet Writes to the board, however, with this Ethernet Write command the board will does not return any responses. The data will be padded with zeros if the register is wider than the data width, or truncated if the register is narrower than the data width. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_WriteBlock_NoReply (int32_t cardIndex, uint16_t blockid, uint32_t regwidth, uint32_t count, uint32_t data[]) |
Same functionality as the Ethernet Write data to registers defined in the Block Configuration for the Block ID specified, however, with this Ethernet Write Block command the board will does not return any responses. A Block is a list of register addresses to be read or written in a single operation. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_Ether_WriteZBlock_NoReply (int32_t cardIndex, uint16_t blockid, uint32_t regwidth, uint32_t count, uint32_t data[]) |
Same functionality as the Ethernet Write data to registers defined in the Z-Block Configuration for the Block ID specified, however, with this Ethernet Write Block command the board will does not return any responses. A Z-Block is a list of register addresses to be read or written in a single operation. Z-Blocks are similar to the regular Block Configuration with a single difference: Z-Blocks may contain on-board and off-board addresses in a single block. The regular Block is restricted to all on-board or all off-board register addresses. | |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_ClearBlock | ( | int32_t | cardIndex, |
uint16_t | blockid ) |
Clears the Block Configuration for the Block ID specified. A Block is a list of register addresses to be read or written in a single operation.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
blockid | : (Input) Block ID. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_ClearIDRConfig | ( | int32_t | cardIndex, |
uint16_t | idrid ) |
Clears the Interrupt Driven Response Configuration for the IDR ID specified.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
idrid | : (Input) Interrupt Driven Response ID. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_ClearScript | ( | int32_t | cardIndex, |
uint16_t | scriptid ) |
Clears the commands for the Script ID specified.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
scriptid | : (Input) Script ID. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_ClearTDRConfig | ( | int32_t | cardIndex, |
uint16_t | tdrid ) |
Clears the Time Driven Response Configuration for the TDR ID specified.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
tdrid | : (Input) Time Driven Response ID. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_ClearZBlock | ( | int32_t | cardIndex, |
uint16_t | blockid ) |
Clears the Z-Block Configuration for the Block ID specified. A Z-Block is a list of register addresses to be read or written in a single operation. Z-Blocks are similar to the regular Block Configuration with a single difference: Z-Blocks may contain on-board and off-board addresses in a single block. The regular Block is restricted to all on-board or all off-board register addresses.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
blockid | : (Input) Block ID. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_ExecuteScript | ( | int32_t | cardIndex, |
uint16_t | scriptid ) |
Executes the command for the Script ID specified.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
scriptid | : (Input) Script ID. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_GetBlock | ( | int32_t | cardIndex, |
uint16_t | blockid, | ||
uint32_t | arraysize, | ||
uint32_t | outaddress[], | ||
uint32_t * | regcount ) |
Retrieves the Block Configuration for the Block ID specified. A Block is a list of register addresses to be read or written in a single operation.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
blockid | : (Input) Block ID. |
arraysize | : (Input) Array size of address buffer. |
outaddress | : (Output) List of Register Addresses. |
regcount | : (Output) The total number of registers retrieved in the block. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_GetIDRConfig | ( | int32_t | cardIndex, |
uint16_t | idrid, | ||
uint16_t * | outprotocol, | ||
uint16_t * | outiplen, | ||
uint8_t | outip[], | ||
uint16_t * | outport, | ||
uint32_t * | outvector, | ||
uint16_t * | outcount, | ||
uint32_t | arraysize, | ||
uint8_t | outcommand[] ) |
Retrieves the Interrupt Driven Response Configuration for the IDR ID specified.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
idrid | : (Input) Interrupt Driven Response ID. |
outprotocol | : (Output) Response Protocol (Valid values: TCP=0 or UDP=1). |
outiplen | : (Output) Response IP Address Length (Valid values: IPv4=4 or IPv6=6). |
outip | : (Output) Response Address (Destination IPv4 or IPv6 Address). |
outport | : (Output) Response Port (Destination Port). |
outvector | : (Output) Interrupt Vector (Valid values: 1-MAX_ETHER_GEN4_IDR_VECTOR). |
outcount | : (Output) Number of commands to execute. |
arraysize | : (Input) Size of the outcommand array. |
outcommand | : (Output) Commands to execute (Valid commands: ReadRegs, WriteRegs, ReadBlock and WriteBlock). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_GetNoCommsWatchdogTimer | ( | int32_t | cardIndex, |
uint32_t * | outmax_sec_between_ether_comm ) |
Retrieves the maximum number of seconds between Ethernet Op Mode communications. Ethernet Op Mode communications refers only to those messages received by the EtherOpMode Listener application on one of the 4 ports (TCP/UDP 52801/52802. Other active Ethernet protocols do not count toward the timeout count.
For example, if the Timeout is set to a value of 10 decimal, then the Watchdog will trigger when 10 seconds has elapsed since the last Ethernet Op Code communication. If other messages are received (such as ping), in this time window, they do not count and the timer will still trigger. In other words, this timer is for Ethernet Op Mode communication only, NOT ALL communications. Upon triggering, the Script ID designated as the Safe State Script will execute.
The timer is a 1-shot timer. Once triggered, this timer value will be reset to zero. Reprogramming the timer value will re-arm the trigger mechanism.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
outmax_sec_between_ether_comm | : (Output) Maximum time in seconds between Ethernet Op Mode communication before triggering. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_GetSafeStateScriptId | ( | int32_t | cardIndex, |
uint16_t * | outscriptid ) |
Retrieves the Script ID to be designated as the Safe State Script. The Safe Safe Script is executed when the Safe Safe EtherOpMode Communication Timeout criteria event occurs.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
outscriptid | : (Output) Script ID. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_GetTDRConfig | ( | int32_t | cardIndex, |
uint16_t | tdrid, | ||
uint16_t * | outprotocol, | ||
uint16_t * | outiplen, | ||
uint8_t | outip[], | ||
uint16_t * | outport, | ||
uint16_t * | outperiod, | ||
uint16_t * | outcount, | ||
uint32_t | arraysize, | ||
uint8_t | outcommand[] ) |
Retrieves the Time Driven Response Configuration for the TDR ID specified.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
tdrid | : (Input) Time Driven Response ID. |
outprotocol | : (Output) Response Protocol (Valid values: TCP=0 or UDP=1). |
outiplen | : (Output) Response IP Address Length (Valid values: IPv4=4 or IPv6=6). |
outip | : (Output) Response Address (Destination IPv4 or IPv6 Address). |
outport | : (Output) Response Port (Destination Port). |
outperiod | : (Output) Period in milliseconds between responses (Valid values: 40-65535). |
outcount | : (Output) Number of commands to execute. |
arraysize | : (Input) Size of the outcommand array. |
outcommand | : (Output) Commands to execute (Valid commands: ReadRegs, WriteRegs, ReadBlock and WriteBlock). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_GetZBlock | ( | int32_t | cardIndex, |
uint16_t | blockid, | ||
uint32_t | arraysize, | ||
uint16_t | outaddrflags[], | ||
uint32_t | outaddress[], | ||
uint32_t * | regcount ) |
Retrieves the Z-Block Configuration for the Block ID specified. A Z-Block is a list of register addresses to be read or written in a single operation. Z-Blocks are similar to the regular Block Configuration with a single difference: Z-Blocks may contain on-board and off-board addresses in a single block. The regular Block is restricted to all on-board or all off-board register addresses.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
blockid | : (Input) Block ID. |
arraysize | : (Input) Array size of address buffer. |
outaddrflags | : (Output) List of Address Flags (on-board or off-board) associated with list of register addresses. |
outaddress | : (Output) List of Register Addresses. |
regcount | : (Output) The total number of registers retrieved in the block. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_NOP | ( | int32_t | cardIndex | ) |
Ethernet NOP Command - This command communicates to the board for connection testing or synchronous idle. Compatible with all generation of boards that support Ethernet.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_Read | ( | int32_t | cardIndex, |
nai_intf_t | intf, | ||
uint32_t | regwidth, | ||
uint32_t | address, | ||
uint32_t | stride, | ||
uint32_t | count, | ||
uint32_t | datawidth, | ||
void * | outdata ) |
Ethernet Reads from the board. The data will be truncated if the register is wider than the data width, or padded with zeros if the register is narrower than data width.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
intf | : (Input) The interface to perform the read on. |
regwidth | : (Input) The width of the underlying registers. |
address | : (Input) The address to start reading from. |
stride | : (Input) The amount to increment the address after each individual read. |
count | : (Input) The total number of elements to read. |
datawidth | : (Input) The width of the elements in data, in bytes. |
outdata | : (Output) The array to receive the values of the registers. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_ReadBlock | ( | int32_t | cardIndex, |
uint16_t | blockid, | ||
uint32_t | regwidth, | ||
uint32_t | arraysize, | ||
uint32_t | outdata[], | ||
uint32_t * | datacount ) |
Reads the data from the registers defined in the Block Configuration for the Block ID specified. A Block is a list of register addresses to be read or written in a single operation.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
blockid | : (Input) Block ID. |
regwidth | : (Input) The width of the underlying registers. |
arraysize | : (Input) Array size of address buffer. |
outdata | : (Output) List of Register Data. |
datacount | : (Output) The total number of registers data elements retrieved in the block. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_ReadFifo | ( | int32_t | cardIndex, |
nai_intf_t | intf, | ||
uint32_t | dataaddr, | ||
uint32_t | countaddr, | ||
uint32_t | count, | ||
uint32_t * | countremaining, | ||
uint32_t | timeout, | ||
uint32_t | datawidth, | ||
void * | data, | ||
uint32_t * | outread ) |
Attempts to read a fifo over a specified interface. If timeout is set to NAIBRD_FIFO_TIMEOUT_NONE, the operation does not block and up to count words are read from the fifo. Otherwise, the operation waits up to timeout milliseconds for the FIFO's count to exceed count before performing the read. If it times out, no data is read. The behavior of this function is not affected by naibrd_SetFifoIOFnc or naibrd_SetMaster.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
intf | : (Input) The interface to perform the read on. |
dataaddr | : (Input) The address of the FIFO's data register. |
countaddr | : (Input) The address of the FIFO's count register. |
count | : (Input) The number of elements to read from the FIFO. |
countremaining | : (Output) The number of elements remaining in the FIFO. |
timeout | : (Input) The amount of time, in milliseconds, to wait for the FIFO's count to reach count before timing out. |
datawidth | : (Input) The width of the elements in data, in bytes. |
data | : (Output) An array to store the values read. |
outread | : (Output) The number of elements read. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_ReadScript | ( | int32_t | cardIndex, |
uint16_t | scriptid, | ||
uint16_t * | outcount, | ||
uint32_t | arraysize, | ||
uint8_t | outcommand[] ) |
Retrieves the commands for the Script ID specified.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
scriptid | : (Input) Script ID. |
outcount | : (Output) Number of commands to execute. |
arraysize | : (Input) Size of the outcommand array. |
outcommand | : (Output) Commands to execute (Valid commands: ReadRegs, WriteRegs, ReadBlock and WriteBlock). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_ReadZBlock | ( | int32_t | cardIndex, |
uint16_t | blockid, | ||
uint32_t | regwidth, | ||
uint32_t | arraysize, | ||
uint32_t | outdata[], | ||
uint32_t * | datacount ) |
Reads the data from the registers defined in the Z-Block Configuration for the Block ID specified. A Z-Block is a list of register addresses to be read or written in a single operation. Z-Blocks are similar to the regular Block Configuration with a single difference: Z-Blocks may contain on-board and off-board addresses in a single block. The regular Block is restricted to all on-board or all off-board register addresses.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
blockid | : (Input) Block ID. |
regwidth | : (Input) The width of the underlying registers. |
arraysize | : (Input) Array size of address buffer. |
outdata | : (Output) List of Register Data. |
datacount | : (Output) The total number of registers data elements retrieved in the block. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_RunScript | ( | int32_t | cardIndex, |
uint16_t | scriptid, | ||
int32_t | cmdcount, | ||
int32_t | dataSz, | ||
int32_t * | dataLen, | ||
uint8_t * | data ) |
Runs the command for the Script ID specified. Returns any values returned from the script.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
scriptid | : (Input) Script ID. |
cmdcount | : (Input) Number of commands in the script. |
dataSz | : (Input) Size of buffer to be passed (data). |
dataLen | : (Output) Contains the length of the data stored |
data | : (Output) Pointer to a user defined buffer of size dataSz that will contain the data returned from running the script. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_SetBlock | ( | int32_t | cardIndex, |
uint16_t | blockid, | ||
nai_intf_t | intf, | ||
uint32_t | regwidth, | ||
uint32_t | count, | ||
uint32_t | address[] ) |
Defines the Block Configuration for the Block ID specified. A Block is a list of register addresses to be read or written in a single operation.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
blockid | : (Input) Block ID. |
intf | : (Input) The interface to perform the read on. |
regwidth | : (Input) The width of the underlying registers. |
count | : (Input) The total number of registers defined in the block (1 - MAX_ETHER_BLOCK_REG_CNT). |
address | : (Input) List of Register Addresses. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_SetGen | ( | int32_t | cardIndex, |
nai_ether_gen_t | etherGen ) |
Sets the Ethernet Protocol Generation that should be used to communicate to the board.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
etherGen | : (Input) Generation of the ethernet protocol to use. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_SetIDRConfig | ( | int32_t | cardIndex, |
uint16_t | idrid, | ||
uint16_t | protocol, | ||
uint16_t | iplen, | ||
uint8_t | ip[], | ||
uint16_t | port, | ||
uint32_t | vector, | ||
uint16_t | count, | ||
uint32_t | arraysize, | ||
uint8_t | command[] ) |
Defines the Interrupt Driven Response Configuration for the IDR ID specified.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
idrid | : (Input) Interrupt Driven Response ID. |
protocol | : (Input) Response Protocol (Valid values: TCP=0 or UDP=1). |
iplen | : (Input) Response IP Address Length (Valid values: IPv4=4 or IPv6=6). |
ip | : (Input) Response Address (Destination IPv4 or IPv6 Address). |
port | : (Input) Response Port (Destination Port). |
vector | : (Input) Interrupt vector (Valid values: 1-MAX_ETHER_GEN4_IDR_VECTOR). |
count | : (Input) Number of commands to execute. |
arraysize | : (Input) Size of the outcommand array. |
command | : (Input) Commands to execute (Valid commands: ReadRegs, WriteRegs, ReadBlock and WriteBlock). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_SetNoCommsWatchdogTimer | ( | int32_t | cardIndex, |
uint32_t | max_sec_between_ether_comm ) |
Sets the maximum number of seconds between Ethernet Op Mode communications. Ethernet Op Mode communications refers only to those messages received by the EtherOpMode Listener application on one of the 4 ports (TCP/UDP 52801/52802. Other active Ethernet protocols do not count toward the timeout count.
For example, if the Timeout is set to a value of 10 decimal, then the Watchdog will trigger when 10 seconds has elapsed since the last Ethernet Op Code communication. If other messages are received (such as ping), in this time window, they do not count and the timer will still trigger. In other words, this timer is for Ethernet Op Mode communication only, NOT ALL communications. Upon triggering, the Script ID designated as the Safe State Script will execute.
The timer is a 1-shot timer. Once triggered, this timer value will be reset to zero. Reprogramming the timer value will re-arm the trigger mechanism.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
max_sec_between_ether_comm | : (Input) Maximum time in seconds between Ethernet Op Mode communication before triggering. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_SetSafeStateScriptId | ( | int32_t | cardIndex, |
uint16_t | scriptid ) |
Sets the Script ID to be designated as the Safe State Script. The Safe Safe Script is executed when the Safe Safe EtherOpMode Communication Timeout criteria event occurs.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
scriptid | : (Input) Script ID. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_SetTDRConfig | ( | int32_t | cardIndex, |
uint16_t | tdrid, | ||
uint16_t | protocol, | ||
uint16_t | iplen, | ||
uint8_t | ip[], | ||
uint16_t | port, | ||
uint16_t | period, | ||
uint16_t | count, | ||
uint32_t | arraysize, | ||
uint8_t | command[] ) |
Defines the Time Driven Response Configuration for the TDR ID specified.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
tdrid | : (Input) Time Driven Response ID. |
protocol | : (Input) Response Protocol (Valid values: TCP=0 or UDP=1). |
iplen | : (Input) Response IP Address Length (Valid values: IPv4=4 or IPv6=6). |
ip | : (Input) Response Address (Destination IPv4 or IPv6 Address). |
port | : (Input) Response Port (Destination Port). |
period | : (Input) Period in milliseconds between responses (Valid values: 40-65535). |
count | : (Input) Number of commands to execute. |
arraysize | : (Input) Size of the command array. |
command | : (Input) Commands to execute (Valid commands: ReadRegs, WriteRegs, ReadBlock and WriteBlock). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_SetZBlock | ( | int32_t | cardIndex, |
uint16_t | blockid, | ||
uint32_t | regwidth, | ||
uint32_t | count, | ||
uint16_t | addrflags[], | ||
uint32_t | address[] ) |
Defines the Z-Block Configuration for the Block ID specified. A Z-Block is a list of register addresses to be read or written in a single operation. Z-Blocks are similar to the regular Block Configuration with a single difference: Z-Blocks may contain on-board and off-board addresses in a single block. The regular Block is restricted to all on-board or all off-board register addresses.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
blockid | : (Input) Block ID. |
regwidth | : (Input) The width of the underlying registers. |
count | : (Input) The total number of registers defined in the block (1 - MAX_ETHER_BLOCK_REG_CNT). |
addrflags | : (Input) List of Address Flags (on-board or off-board) associated with list of register addresses. |
address | : (Input) List of Register Addresses. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_StartIDR | ( | int32_t | cardIndex, |
uint16_t | idrid ) |
Starts the Interrupt Driven Response for the IDR ID specified.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
idrid | : (Input) Interrupt Driven Response ID. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_StartTDR | ( | int32_t | cardIndex, |
uint16_t | tdrid ) |
Starts the Time Driven Response for the TDR ID specified.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
tdrid | : (Input) Time Driven Response ID. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_StopIDR | ( | int32_t | cardIndex, |
uint16_t | idrid ) |
Stops the Interrupt Driven Response for the IDR ID specified.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
idrid | : (Input) Interrupt Driven Response ID. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_StopTDR | ( | int32_t | cardIndex, |
uint16_t | tdrid ) |
Stops the Time Driven Response for the TDR ID specified.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
tdrid | : (Input) Time Driven Response ID. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_Write | ( | int32_t | cardIndex, |
nai_intf_t | intf, | ||
uint32_t | regwidth, | ||
uint32_t | address, | ||
uint32_t | stride, | ||
uint32_t | count, | ||
uint32_t | datawidth, | ||
void * | data ) |
Ethernet Writes to the board. The data will be padded with zeros if the register is wider than the data width, or truncated if the register is narrower than the data width.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
intf | : (Input) The interface to perform the read on. |
regwidth | : (Input) The width of the underlying registers. |
address | : (Input) The address to start reading from. |
stride | : (Input) The amount to increment the address after each individual read. |
count | : (Input) The total number of elements to read. |
datawidth | : (Input) The width of the elements in data, in bytes. |
data | : (Output) The array to receive the values of the registers. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_Write_NoReply | ( | int32_t | cardIndex, |
nai_intf_t | intf, | ||
uint32_t | regwidth, | ||
uint32_t | address, | ||
uint32_t | stride, | ||
uint32_t | count, | ||
uint32_t | datawidth, | ||
void * | data ) |
Same functionality as the Ethernet Writes to the board, however, with this Ethernet Write command the board will does not return any responses. The data will be padded with zeros if the register is wider than the data width, or truncated if the register is narrower than the data width.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
intf | : (Input) The interface to perform the read on. |
regwidth | : (Input) The width of the underlying registers. |
address | : (Input) The address to start reading from. |
stride | : (Input) The amount to increment the address after each individual read. |
count | : (Input) The total number of elements to read. |
datawidth | : (Input) The width of the elements in data, in bytes. |
data | : (Output) The array to receive the values of the registers. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_WriteBlock | ( | int32_t | cardIndex, |
uint16_t | blockid, | ||
uint32_t | regwidth, | ||
uint32_t | count, | ||
uint32_t | data[] ) |
Write data to registers defined in the Block Configuration for the Block ID specified. A Block is a list of register addresses to be read or written in a single operation.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
blockid | : (Input) Block ID. |
regwidth | : (Input) The width of the underlying registers. |
count | : (Input) The total number of registers defined in the block. |
data | : (Input) List of Register Data. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_WriteBlock_NoReply | ( | int32_t | cardIndex, |
uint16_t | blockid, | ||
uint32_t | regwidth, | ||
uint32_t | count, | ||
uint32_t | data[] ) |
Same functionality as the Ethernet Write data to registers defined in the Block Configuration for the Block ID specified, however, with this Ethernet Write Block command the board will does not return any responses. A Block is a list of register addresses to be read or written in a single operation.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
blockid | : (Input) Block ID. |
regwidth | : (Input) The width of the underlying registers. |
count | : (Input) The total number of registers defined in the block. |
data | : (Input) List of Register Data. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_WriteScript | ( | int32_t | cardIndex, |
uint16_t | scriptid, | ||
uint16_t | cmdcount, | ||
uint32_t | arraysize, | ||
uint8_t | command[] ) |
Defines the commands for the Script ID specified.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
scriptid | : (Input) Script ID. |
cmdcount | : (Input) Number of commands to execute. |
arraysize | : (Input) Size of the command array. |
command | : (Input) Commands to execute (Valid commands: NOP, ReadRegs, WriteRegs, ReadFIFO, MaskReg, and MaskValueReg). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_WriteZBlock | ( | int32_t | cardIndex, |
uint16_t | blockid, | ||
uint32_t | regwidth, | ||
uint32_t | count, | ||
uint32_t | data[] ) |
Write data to registers defined in the Z-Block Configuration for the Block ID specified. A Z-Block is a list of register addresses to be read or written in a single operation. Z-Blocks are similar to the regular Block Configuration with a single difference: Z-Blocks may contain on-board and off-board addresses in a single block. The regular Block is restricted to all on-board or all off-board register addresses.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
blockid | : (Input) Block ID. |
regwidth | : (Input) The width of the underlying registers. |
count | : (Input) The total number of registers defined in the block. |
data | : (Input) List of Register Data. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_Ether_WriteZBlock_NoReply | ( | int32_t | cardIndex, |
uint16_t | blockid, | ||
uint32_t | regwidth, | ||
uint32_t | count, | ||
uint32_t | data[] ) |
Same functionality as the Ethernet Write data to registers defined in the Z-Block Configuration for the Block ID specified, however, with this Ethernet Write Block command the board will does not return any responses. A Z-Block is a list of register addresses to be read or written in a single operation. Z-Blocks are similar to the regular Block Configuration with a single difference: Z-Blocks may contain on-board and off-board addresses in a single block. The regular Block is restricted to all on-board or all off-board register addresses.
cardIndex | : (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1). |
blockid | : (Input) Block ID. |
regwidth | : (Input) The width of the underlying registers. |
count | : (Input) The total number of registers defined in the block. |
data | : (Input) List of Register Data. |