![]() |
![]() |
![]() |
This API is used by program running on the Real-Time host to access and configure the RTDB.
Those programs must map the RTDB into their address space before accessing it with any of the functions described here.
#define MAX_NAMESPACE 128 |
Utility object to retrieve initial condition for data items.
#define NI_BOARD_MASK 0x100 |
The board identification.
typedef struct RTDBItemPair* RTDBItemPairPtr |
typedef char ItemName[MAX_TAGLEN] |
Utility object that defines the name of an RTDB item.
enum PointType |
enum RTDB_CVTType |
Supported data type for a RTDB item value.
enum RTDB_RawType |
Supported data type for a RTDB raw value.
enum RTDB_RunTimeFlags |
Run time flags associated to an RTDB item.
enum IO_Flags |
Additional flags for for the I/O record. Describes some additional properties specific to the device.
enum MSGIO_Flags |
Run time flags for an message oriented device such as ARINC 429,AFDX or CAN . Not all flags apply to all devices
enum EUConversionType |
Type of entry in the conversion table.
enum RTDB_MetaFlags |
Meta flags for an RTDB item. Describe specific properties of the RTDB item such as : item has EU conversion, is logged in the data logger,etc.
enum ARINC429_Speed |
enum ARINC429_Parity |
enum Serial_Type |
int ccurRTDB_afdxAddMessage | ( | int | boardNumber, | |
unsigned short | vlId, | |||
IOAFDXMessage * | message | |||
) |
Add an AFDX message definition to the resident AFDX message table.
AFDXResidentMessage* ccurRTDB_afdxFindMessage | ( | int | boardId, | |
int | boardNumber, | |||
unsigned short | vlId, | |||
const char * | name | |||
) |
Search the resident AFDX message table for a message.
int ccurRTDB_afdxSetDestinationIP | ( | int | boardNumber, | |
unsigned short | vlId, | |||
const char * | name, | |||
unsigned int | ip, | |||
unsigned short | port | |||
) |
Set the destination IP and port for an output AFDX message.
This only applies for SAP type message where the destination must be specified at run time. Initially, the destination is set to the default saved in the disk resident database.
int ccurRTDB_afdxGetSourceIP | ( | int | boardNumber, | |
unsigned short | vlId, | |||
const char * | name, | |||
unsigned int * | ip, | |||
unsigned short * | port | |||
) |
Get the source IP and port for an input AFDX message.
This only applies for SAP type message where the originator IP and port are known upon message reception.
unsigned long long ccurRTDB_afdxGetTimeStamp | ( | int | boardNumber, | |
unsigned short | vlId, | |||
const char * | name | |||
) |
Get the message time stamp for the last read or write.
AFDXResidentMessage* ccurRTDB_afdxGetMessageTable | ( | void | ) |
Returns a pointer to the resident message table AFDXMessageTable.
The | address of the resident message table. |
< | 0 RTDB_AFDXMSGNOTFOUND if message was not found in table. |
void ccurRTDB_afdxInitMessageTable | ( | void | ) |
Initialize afdx message table.
void ccurRTDB_arinc429InitTable | ( | void | ) |
Initialize CAN message table.
ARINC429LabelProperties* ccurRTDB_arinc429GetLabelTable | ( | void | ) |
Returns a pointer to the ARINC429 label table .
The | address of the resident ARINC429 label table. This a pointer to a |
int ccurRTDB_arinc429GetTableIndex | ( | int | boardId, | |
int | boardNum, | |||
int | channelNum, | |||
int | labelNum | |||
) |
Return the index in the ARINC429LabelProperties table of the specified label number. The address of the ARINC429 label table must be obtained by a call to ccurRTDB_arinc429GetLabelTable(). The specific label structure can then be accessed by pTable[index] where index is the value returned by this routine.
boardId | integer with the board Id. Either ARINC429 or BTI_Lx429 or DD_429_92 | |
boardNum | The board number (first board is 1) where the label is defined. | |
channelNum | The channel number (0-15). | |
labelNum | The label number. |
The | index of the specified label in the table or -1 if it cannot be foumd. |
int ccurRTDB_arinc429TXQueueNow | ( | RTDBItem * | pItem | ) |
Request that the value of label defined in FIFO queueing mode be sent now. If the item specified is mapped to multiple ARINC label , all of the them will be transmitted. FIFO mode labels with IOFL_TXONCHANGE are only transmitted upon user request.
int ccurRTDB_arinc429TXQueueNowLabel | ( | int | boardId, | |
int | boardNum, | |||
int | channelNum, | |||
int | labelNum | |||
) |
Request that the value of label defined in FIFO queueing mode be sent now. FIFO mode labels are only transmitted upon user request.
void ccurRTDB_canInitTable | ( | void | ) |
Initialize CAN message table.
CANIdProperties* ccurRTDB_canGetCANIdTable | ( | void | ) |
Returns a pointer to the CAN Id's table .
The | address of the resident CAN Id's table. This a pointer to a |
int ccurRTDB_canGetTableIndex | ( | int | boardId, | |
int | boardNum, | |||
int | netNum, | |||
int | canId, | |||
int | type | |||
) |
Return the index in the CANIdProperties table of the specified CAN id. The address of the CAN id table must be obtained by a call to ccurRTDB_canGetCANIdTable(). The specifi CAN id can then be accessed by pCanTable[index] where index is the value returned by this routine.
boardId | The board type where the CAN is defined. I.e. one of CANIO_ESD405(15) or CANIO_PEAK (21). | |
boardNum | The board number (first board is 1) where the CAN is defined. | |
netNum | The net number (0-3). | |
canId | The CAN id. | |
type | Input or output of the CAN id. Must be SimWB_DIR_INPUT or SimWB_DIR_OUTPUT. |
The | index of the CAN id in the table or -1 if it cannot be foumd. |
CANIdProperties* ccurAsyncIO_canGetCANId | ( | int | boardId, | |
int | boardNum, | |||
int | netNum, | |||
int | canId, | |||
int | type | |||
) |
Return a pointerto of the specified CAN id record.
boardId | The board type where the CAN is defined. I.e. one of CANIO_ESD405(15) or CANIO_PEAK (21). | |
boardNum | The board number (first board is 0) where the CAN is defined. | |
netNum | The net number (0-3). | |
canId | The CAN id. | |
type | Input or output of the CAN id. Must be SimWB_DIR_INPUT or SimWB_DIR_OUTPUT. |
The | pointer to the CAN id record on success. NULL if the record cannot be found. |
CIGIResidentMessage* ccurRTDB_cigiIOGetMessageTable | ( | void | ) |
Returns a pointer to the resident message table CIGIMessageTable.
The | address of the resident message table. |
void ccurRTDB_cigiIOInitMessageTable | ( | void | ) |
Initialize CIGI message table.
FDXResidentMessage* ccurRTDB_fdxIOGetMessageTable | ( | void | ) |
Returns a pointer to the resident message table FDXMessageTable.
The | address of the resident message table. |
void ccurRTDB_fdxIOInitMessageTable | ( | void | ) |
Initialize FDX message table.
void ccurRTDB_linInitTable | ( | void | ) |
Initialize LIN message table.
LINIdProperties* ccurRTDB_linGetLINIdTable | ( | void | ) |
Returns a pointer to the LIN Id's table .
The | address of the resident LIN Id's table. This a pointer to a |
int ccurRTDB_linGetTableIndex | ( | int | boardId, | |
int | boardNum, | |||
int | netNum, | |||
int | frameId, | |||
int | type | |||
) |
Return the index in the LINIdProperties table of the specified LIN id. The address of the LIN id table must be obtained by a call to ccurRTDB_linGetLINIdTable(). The specifi LIN id can then be accessed by pCanTable[index] where index is the value returned by this routine.
boardId | The board type where the LIN is defined. I.e. one of BABY_LIN(72) . | |
boardNum | The board number (first board is 1) where the LIN is defined. | |
netNum | The net number (0-3). | |
frameId | The LIN frame id. | |
type | Input or output of the LIN id. Must be SimWB_DIR_INPUT or SimWB_DIR_OUTPUT. |
The | index of the LIN id in the table or -1 if it cannot be foumd. |
LINIdProperties* ccurAsyncIO_linGetLINId | ( | int | boardId, | |
int | boardNum, | |||
int | netNum, | |||
int | canId, | |||
int | type | |||
) |
Return a pointerto of the specified LIN id record.
boardId | The board type where the LIN is defined. I.e. one of BABY_LIN(72) . | |
boardNum | The board number (first board is 0) where the LIN is defined. | |
netNum | The net number (0-3). | |
canId | The LIN id. | |
type | Input or output of the LIN id. Must be SimWB_DIR_INPUT or SimWB_DIR_OUTPUT. |
The | pointer to the LIN id record on success. NULL if the record cannot be found. |
NETResidentMessage* ccurRTDB_netIOGetMessageTable | ( | void | ) |
Returns a pointer to the resident message table NETMessageTable.
The | address of the resident message table. |
void ccurRTDB_netIOInitMessageTable | ( | void | ) |
Initialize NET message table.
void ccurRTDB_sentInitTable | ( | void | ) |
Initialize SENT message table.
SENTIdProperties* ccurRTDB_sentGetSENTIdTable | ( | void | ) |
Returns a pointer to the SENT Id's table .
The | address of the resident SENT Id's table. This a pointer to a |
int ccurRTDB_sentGetTableIndex | ( | int | boardId, | |
int | boardNum, | |||
int | channelNum, | |||
int | sentId, | |||
int | type | |||
) |
Return the index in the SENTIdProperties table of the specified SENT id.
boardId | The board type where the SENT is defined. I.e. one of CP_SENT(80) or CP_FPGA_ArV (77) or CP_CMFIO (104) or CP_FPGA_ArX (110) | |
boardNum | The board number (first board is 1) where the SENT id is defined. | |
channelNum | The channel number (0-11). | |
sentId | The value of the SENT id. | |
type | Input or output of the SENT id. Must be SimWB_DIR_INPUT or SimWB_DIR_OUTPUT. |
The | index of the SENT id in the table or -1 if it cannot be foumd. |
SENTIdProperties* ccurAsyncIO_sentGetSENTId | ( | int | boardId, | |
int | boardNum, | |||
int | channelNum, | |||
int | sentId, | |||
int | type | |||
) |
Return a pointerto of the specified SENT id record.
boardId | The board type where the SENT is defined. I.e. one of CP_SENT(80) or CP_FPGA_ArV (77) or CP_CMFIO (104) or CP_FPGA_ArX (110) | |
boardNum | The board number (first board is 0) where the SENT id is defined. | |
channelNum | The channel number (0-11). | |
sentId | The value of the SENT id. | |
type | Input or output of the SENT id. Must be SimWB_DIR_INPUT or SimWB_DIR_OUTPUT. |
The | pointer to the SENT id record on success. NULL if the record cannot be found. |
UDPResidentMessage* ccurRTDB_udpIOGetMessageTable | ( | void | ) |
Returns a pointer to the resident message table NETMessageTable.
The | address of the resident message table. |
void ccurRTDB_udpIOInitMessageTable | ( | void | ) |
Initialize NET message table.
int ccurRTDB_initDB | ( | int | maxPoints, | |
int | maxCVTSize, | |||
int | maxStringVariables | |||
) |
Initialize the RTDB database and make room for a maximum of maxPoints items and a maximum of string variables.
maxPoints | The maximum number of items we want to store in the RTDB including model parameters. | |
maxCVTEntries | The maximum number of entries in the CVT and Alternate value tables. | |
maxStringVariables | The maximum number of string variables that the RTDB will contain. |
0 | On success. | |
-1 | On failure. errno will be set with error corresponding to the system call that failed. |
int ccurRTDB_clearDB | ( | void | ) |
Clear the current RTDB in shared memory.
This will clear all the items in memory by clearing the hash table. Deallocating all the string variables and clearing the db name.
0 | Always. |
void ccurRTDB_resetCVTtoZero | ( | void | ) |
Reset CVT values of all the items defined in the currently loaded RTDB to zero.
int ccurRTDB_mapDB | ( | ) |
Map the current RTDB in memory into the caller's address space.
0 | On success. | |
-1 | On failure. errno will be set with error corresponding to the system call that failed. |
volatile void* ccurRTDB_getCVTTableAddress | ( | ) |
Return a pointer to the CVT table.
Pointer | to the CVT in the process addressing space. |
volatile void* ccurRTDB_getAlternateTableAddress | ( | ) |
Return a pointer to the alternate value table.
Pointer | to the alternate value table in the process addressing space. |
volatile void* ccurRTDB_getRawTableAddress | ( | ) |
Return a pointer to the raw value table.
Pointer | to the raw value table in the process addressing space. |
int ccurRTDB_getCVTSize | ( | void | ) |
Return the size of the CVT table.
The | size of the CVT table in bytes. |
int ccurRTDB_deleteItem | ( | const char * | key | ) |
Remove an item from the RTDB.
key | The name of the item to remove |
0 | on success. | |
< | 0 RTDB_POINTNOTFOUND if the item is not in the RTDB. |
int ccurRTDB_addItem | ( | const char * | key, | |
RTDBItemMetaPair * | itemMeta | |||
) |
Add a RTDB item to the database.
key | The name of the item | |
itemMeta | Pointer to the item meta data to store in the RTDB. |
>=0 | The index in RTDB of the newly allocated item. | |
< | 0 On failure ( RTDB_POINTEXISTS , RTDB_DBNOROOM ) |
int ccurRTDB_addSpareItem | ( | int | itemIndex, | |
int | pointType, | |||
int | cvtType | |||
) |
Add a spare RTDB item to the database. This only adds an entry into the spare item table but does not add it to the list of items in the RTDB. This ccurRTDB_addItem must be used prior to this.
itemIndex | The index pRTDB where this item is at. This comes from a previous call to ccurRTDB_addItem. | |
pointType | The point type for this new item. | |
cvtType | The CVT type for this new item. |
==0 | When successful. This routine only fails when the spare item table if full. | |
< | 0 On failure ( RTDB_DBNOROOM ) |
int ccurRTDB_takeSpareItem | ( | const char * | newName, | |
int | pointType, | |||
int | cvtType | |||
) |
Rename a spare RTDB item in the RTDB to a new name and take it out of the spare item table.
newName | The name to use for the new item. | |
pointType | The point type defining the type of point to take . | |
cvtType | The CVT type for this new item. |
>=i | 0 When successful. This routine only fails when the spare item table if full. | |
< | 0 On failure ( RTDB_POINTEXISTS when the newName already exists in the RTDB RTDB_NOSPAREITEM when no more spare items of the specified type are available. ) |
int ccurRTDB_renameItem | ( | const char * | oldName, | |
const char * | newName | |||
) |
Rename a RTDB item in the RTDB. This called is used by the data logger replay mechanism to rename RTDB items that have been created at run time.
oldName | The name of the item to be renamed. | |
newName | The name to use for the new item. |
>=i | 0 When successful. This routine only fails when the spare item table if full. | |
< | 0 On failure ( RTDB_POINTEXISTS when the newName already exists in the RTDB RTDB_POINTNOTFOUND when the old name is not found in the RTDB. ) |
int ccurRTDB_addHardwareConfig | ( | const char * | key, | |
HardwareConfig * | cfg | |||
) |
Add a HardwareConfig Record to the RTDB.
key | The name of the item | |
cfg | Pointer to the HardwareRecord in the RTDB. |
>=0 | The index in HardwareConfig table of the newly allocated item. | |
< | 0 On failure ( RTDB_POINTEXISTS , RTDB_DBNOROOM ) |
int ccurRTDB_getCVTItemSize | ( | const RTDBItem * | p | ) |
Return the size in byte of an item in the cvt based on its 'C' type.
String variables are not in the CVT and thus the size returned for string variables is '0'.
p | Pointer to the RTDB item. |
The | size of the item. |
int ccurRTDB_setStringValue | ( | const char * | pointName, | |
StringVariableValue * | value, | |||
int | length | |||
) |
Set the value of a RTDB string variable.
pointName | The name of the RTDB item. | |
value | Pointer to the value for the string variable. | |
length | The length in bytes of the data in the string variable. |
0 | On success. | |
< | 0 On failure (RTDB_POINTNOTFOUND , RTDB_NOTSTRINGVAR , RTDB_NOSTRINGMEMORY ) |
int ccurRTDB_setStringValueP | ( | const RTDBItem * | p, | |
StringVariableValue * | value, | |||
int | length | |||
) |
Set the value of a RTDB string variable by address.
p | The address of the RTDB item. | |
value | Pointer to the value for the string variable. | |
length | The length in bytes of the data in the string variable. |
0 | On success. | |
< | 0 On failure (RTDB_POINTNOTFOUND , RTDB_NOTSTRINGVAR , RTDB_NOSTRINGMEMORY ) |
int ccurRTDB_setStringAltValueP | ( | const RTDBItem * | p, | |
StringVariableValue * | value, | |||
int | length | |||
) |
Set the alternate value of a RTDB string variable by address.
p | The address of the RTDB item. | |
value | Pointer to the value for the string variable. | |
length | The length in bytes of the data in the string variable. |
0 | On success. | |
< | 0 On failure (RTDB_POINTNOTFOUND , RTDB_NOTSTRINGVAR , RTDB_NOSTRINGMEMORY ) |
int ccurRTDB_setStringAltValue | ( | const char * | pointName, | |
StringVariableValue * | value, | |||
int | length | |||
) |
Set the alternate value of a RTDB string variable .
pointName | The name of the RTDB item. | |
value | Pointer to the value for the string variable. | |
length | The length in bytes of the data in the string variable. |
0 | On success. | |
< | 0 On failure (RTDB_POINTNOTFOUND , RTDB_NOTSTRINGVAR , RTDB_NOSTRINGMEMORY ) |
int ccurRTDB_setStringDefaultValueP | ( | RTDBItem * | p, | |
StringVariableValue * | value, | |||
int | length | |||
) |
Set the default value of a RTDB string variable by address.
p | The address of the RTDB item. | |
value | Pointer to the value for the string variable. | |
length | The length in bytes of the data in the string variable. |
0 | On success. | |
< | 0 On failure (RTDB_POINTNOTFOUND , RTDB_NOTSTRINGVAR , RTDB_NOSTRINGMEMORY ) |
int ccurRTDB_setStringDefaultValue | ( | const char * | pointName, | |
StringVariableValue * | value, | |||
int | length | |||
) |
Set the default value of a RTDB string variable.
pointName | The name of the RTDB item. | |
value | Pointer to the value for the string variable. | |
length | The length in bytes of the data in the string variable. |
0 | On success. | |
< | 0 On failure (RTDB_POINTNOTFOUND , RTDB_NOTSTRINGVAR , RTDB_NOSTRINGMEMORY ) |
int ccurRTDB_getStringDefaultValue | ( | const char * | pointName, | |
StringVariableValue * | value, | |||
int * | length | |||
) |
Get the default value of a string variable.
pointName | The name of the RTDB item. | |
value | Pointer to the value for the string variable. | |
length | The length in bytes of the data in the string variable. |
0 | On success. | |
< | 0 On failure (RTDB_POINTNOTFOUND , RTDB_NOTSTRINGVAR , RTDB_NOSTRINGMEMORY ) |
int ccurRTDB_getStringDefaultValueP | ( | const RTDBItem * | p, | |
StringVariableValue * | value, | |||
int * | length | |||
) |
Get the default value of a string variable.
p | Pointer to the RTDB item. | |
value | Pointer to the value for the string variable. | |
length | The length in bytes of the data in the string variable. |
0 | On success. | |
< | 0 On failure (RTDB_POINTNOTFOUND , RTDB_NOTSTRINGVAR , RTDB_NOSTRINGMEMORY ) |
int ccurRTDB_getStringValue | ( | const char * | pointName, | |
StringVariableValue * | value, | |||
int * | length | |||
) |
Get the value of a string variable.
pointName | The name of the RTDB item. | |
value | Pointer to the value for the string variable. | |
length | The length in bytes of the data in the string variable. |
0 | On success. | |
< | 0 On failure (RTDB_POINTNOTFOUND , RTDB_NOTSTRINGVAR , RTDB_NOSTRINGMEMORY ) |
int ccurRTDB_getStringValueP | ( | const RTDBItem * | p, | |
StringVariableValue * | value, | |||
int * | length | |||
) |
Get the value of a string variable.
p | Pointer to the RTDB item. | |
value | Pointer to the value for the string variable. | |
length | The length in bytes of the data in the string variable. |
0 | On success. | |
< | 0 On failure (RTDB_POINTNOTFOUND , RTDB_NOTSTRINGVAR , RTDB_NOSTRINGMEMORY ) |
int ccurRTDB_getStringValueLengthP | ( | const RTDBItem * | p | ) |
Get the length of a string variable.
p | Pointer to the RTDB item. |
0 | The length of the string on success. | |
< | 0 On failure (RTDB_POINTNOTFOUND , RTDB_NOTSTRINGVAR , RTDB_NOSTRINGMEMORY ) |
int ccurRTDB_getStringAltValue | ( | const char * | pointName, | |
StringVariableValue * | value, | |||
int * | length | |||
) |
Get the alternate value of a string variable.
pointName | The name of the RTDB item. | |
value | Pointer to the value for the string variable. | |
length | The length in bytes of the data in the string variable. |
0 | On success. | |
< | 0 On failure (RTDB_POINTNOTFOUND , RTDB_NOTSTRINGVAR , RTDB_NOSTRINGMEMORY ) |
int ccurRTDB_getStringAltValueP | ( | const RTDBItem * | p, | |
StringVariableValue * | value, | |||
int * | length | |||
) |
Get the alternate value of a string variable.
p | Pointer to the RTDB item. | |
value | Pointer to the value for the string variable. | |
length | The length in bytes of the data in the string variable. |
0 | On success. | |
< | 0 On failure (RTDB_POINTNOTFOUND , RTDB_NOTSTRINGVAR , RTDB_NOSTRINGMEMORY ) |
int ccurRTDB_getStringAltValueLengthP | ( | const RTDBItem * | p | ) |
Get the length of a string variable alternate value.
p | Pointer to the RTDB item. |
0 | The length of the string on success. | |
< | 0 On failure (RTDB_POINTNOTFOUND , RTDB_NOTSTRINGVAR , RTDB_NOSTRINGMEMORY ) |
double ccurRTDB_getCVTValueDouble | ( | const char * | pointName | ) |
Return the CVT value of an RTDB item as a 'C' double.
If the RTDB item is an array, this routine always returns 0. Use ccurRTDB_getCVTValueP for non scalar RTDB items.
pointName | The name of the RTDB item. |
The | CVT value of the RTDB item or 0 if the item is a string variable. |
double ccurRTDB_getCVTValuePDouble | ( | const RTDBItem * | p | ) |
Return the CVT value of an RTDB item as a 'C' double.
If the RTDB item is an array, this routine always returns 0. Use ccurRTDB_getCVTValueP for non scalar RTDB items.
p | Pointer to the RTDB item. |
The | CVT value of the RTDB item or 0 if the item is a string variable. |
double ccurRTDB_getAlternateValueDouble | ( | const char * | pointName | ) |
Return the alternate value of an RTDB item as a 'C' double.
If the RTDB item is an array, this routine always returns 0. Use ccurRTDB_getAlternateValue for non scalar RTDB items.
pointName | The name of the RTDB item. |
The | alternate value of the RTDB item or 0 if the item is a string variable. |
double ccurRTDB_getAlternateValuePDouble | ( | const RTDBItem * | p | ) |
Return the alternate value of an RTDB item as a 'C' double.
If the RTDB item is an array, this routine always returns 0. Use ccurRTDB_getAlternateValueP for non scalar RTDB items.
p | Pointer to the RTDB item. |
The | alternate value of the RTDB item or 0 if the item is a string variable. |
double ccurRTDB_getCurrentValueDouble | ( | const char * | pointName | ) |
Return the current value of an RTDB item as a 'C' double.
When the RTDB item is non-scalar, this routines always returns 0. The current value is always the CVT value for input points whereas for output points, the current value is the alternate value when either the alternate or operator flags is set.
If the item is not defined in the CVT. The alternate value is returned.
If it is an INPUT point, the value comes from the CVT since when overridden the I/O value goes into the alternate value. If it is OUTPUT point, it comes from the alternate value if the CVT value has been overridden (RTDBFL_ALTVALUE | RTDBFL_OPERATOR is set) and the alternate is the value used to do the physical output.
pointName | The name of the RTDB item. |
The | CVT value of the RTDB item or 0 if the item is a string variable. |
double ccurRTDB_getCurrentValuePDouble | ( | const RTDBItem * | p | ) |
Return the current value of an RTDB item as a 'C' double.
When the RTDB item is non-scalar, this routines always returns 0. The current value is always the CVT value for input points whereas for output points, the current value is the alternate value when either the alternate or operator flags is set.
If the item is not defined in the CVT. The alternate value is returned.
If it is an INPUT point, the value comes from the CVT since when overridden the I/O value goes into the alternate value. If it is OUTPUT point, it comes from the alternate value if the CVT value has been overridden (RTDBFL_ALTVALUE | RTDBFL_OPERATOR is set) and the alternate is the value used to do the physical output.
p | Pointer to the RTDB item. |
The | CVT value of the RTDB item or 0 if the item is a string variable. |
void ccurRTDB_setAlternateValueDouble | ( | const char * | pointName, | |
double | varValue | |||
) |
Set the Alternate value of an RTDB item. The value is passed to the call as a 'C' double. If the RTDB item is an array, this routine returns immediately. Use ccurRTDB_setAlternateValue to set the value for non scalar items.
pointName | The name of RTDB item. | |
varValue | The value to be set. |
void ccurRTDB_setAlternateValuePDouble | ( | const RTDBItem * | p, | |
double | varValue | |||
) |
Set the Alternate value of an RTDB item. The value is passed to the call as a 'C' double.
If the RTDB item is an array, this routine returns immediately. Use ccurRTDB_setAlternateValueP to set the value for non scalar items.
p | Pointer to the RTDB item. | |
varValue | The value to be set. |
void ccurRTDB_setCVTValueDouble | ( | const char * | pointName, | |
double | varValue | |||
) |
Set the CVT value of an RTDB item. The value is passed to the call as a 'C' double. If the RTDB item is an array, this routine returns immediately. Use ccurRTDB_setCVTValue to set the value for non scalar items.
pointName | The name of the RTDB item. | |
varValue | The value to be set. |
void ccurRTDB_setCVTValuePDouble | ( | const RTDBItem * | p, | |
double | varValue | |||
) |
Set the CVT value of an RTDB item. The value is passed to the call as a 'C' double. If the RTDB item is an array, this routine returns immediately. Use ccurRTDB_setCVTValueP to set the value for non scalar items.
p | Pointer to the RTDB item. | |
varValue | The value to be set. |
void ccurRTDB_setCurrentValueDouble | ( | const char * | pointName, | |
double | varValue | |||
) |
Set the current value of an RTDB item. The value is passed to the call as a 'C' double.
If the RTDB item is an array, this routine returns immediately. Use ccurRTDB_setCurrentValue to set the value for non scalar items.
The current value is always the CVT value for input points whereas for output points, the current value is the alternate value when either the alternate or operator flags is set.
If the item is not defined in the CVT. It will be stored in the alternate value.
If it is an INPUT point, it goes in the CVT since when overridden the I/O value goes in the alternate value. If it is OUTPUT point, it goes in the alternate value if the CVT value has been overridden (RTDBFL_ALTVALUE is set) and alternate is the value used to do the physical output.
pointName | The name of the RTDB item. | |
varValue | The value to be set. |
void ccurRTDB_setCurrentValuePDouble | ( | const RTDBItem * | p, | |
double | varValue | |||
) |
Set the current value of an RTDB item. The value is passed to the call as a 'C' double.
If the RTDB item is an array, this routine returns immediately. Use ccurRTDB_setCurrentValueP to set the value for non scalar items.
The current value is always the CVT value for input points whereas for output points, the current value is the alternate value when either the alternate or operator flags is set.
If the item is not defined in the CVT. It will be stored in the alternate value.
If it is an INPUT point, it goes in the CVT since when overridden the I/O value goes in the alternate value. If it is OUTPUT point, it goes in the alternate value if the CVT value has been overridden (RTDBFL_ALTVALUE is set) and alternate is the value used to do the physical output.
p | Pointer to the RTDB item. | |
varValue | The value to be set. |
double ccurRTDB_getRawValueDouble | ( | const char * | pointName | ) |
Return the raw value of an RTDB item as a 'C' double
pointName | The name of the RTDB item. |
The | raw value of the RTDB item or 0 if the item is a string variable. |
double ccurRTDB_getRawValuePDouble | ( | const RTDBItem * | p | ) |
Return the raw value of an RTDB item as a 'C' double
p | Pointer to the RTDB item. |
The | raw value of the RTDB item or 0 if the item is a string variable. |
int ccurRTDB_getCVTValueP | ( | const RTDBItem * | p, | |
ItemValueDef * | value | |||
) |
Return the CVT value of an RTDB item by address.
p | Pointer to the RTDB item. | |
value | Pointer to an ItemValueDef where the value is stored. The array of values is allocated by this call (malloc) if value.numElements == 0 or < meta.numElements, otherwise it is assumed that the array pointed by value->value.Val.Array has already been allocated by the caller and is large enough to hold the item values. It is the responsibility of the caller to free this array when no longer needed. When preallocating the array value->value.numMallocedElements should be set to the number of elements for this item. |
0 | On success. | |
< | 0 RTDB_POINTNOTFOUND or RTDB_NOTINCVT |
int ccurRTDB_getCVTValuePMaxElements | ( | const RTDBItem * | p, | |
ItemValueDef * | value, | |||
int | max | |||
) |
Return the CVT value of an RTDB item by address.
p | Pointer to the RTDB item. | |
value | Pointer to an ItemValueDef where the value is stored. | |
max | The maximum number of elements to return. This only applies to array type RTDB variables The array of values is allocated by this call (malloc) if value.numElements == 0 or < meta.numElements, otherwise it is assumed that the array pointed by value->value.Val.Array has already been allocated by the caller and is large enough to hold the item values. It is the responsibility of the caller to free this array when no longer needed. When preallocating the array value->value.numMallocedElements should be set to the number of elements for this item. |
0 | On success. | |
< | 0 RTDB_POINTNOTFOUND or RTDB_NOTINCVT |
int ccurRTDB_getCVTValuePScalar | ( | const RTDBItem * | p, | |
ItemValueDefScalar * | value, | |||
int | index | |||
) |
Return the CVT value of a scalar only RTDB item by address.
p | Pointer to the RTDB item. | |
value | Pointer to an ItemValueDef where the value is stored. | |
index | into array. Use 0 for RTDB item defined as scalars. |
0 | On success. | |
< | 0 RTDB_POINTNOTFOUND or RTDB_NOTINCVT |
int ccurRTDB_getCVTValue | ( | const char * | pointName, | |
ItemValueDef * | value | |||
) |
Return the CVT value of an RTDB item.
pointName | The name of the RTDB item. | |
value | Pointer to an ItemValueDef where the value is stored. The array of values is allocated by this call (malloc) if value.numElements == 0 or < meta.numElements, otherwise it is assumed that the array pointed to by value->value.Val.Array has already been allocated by the caller and is large enough to hold the item values. It is the responsibility of the caller to free this array when no longer needed. When preallocating the array value->value.numMallocedElements should be set to the number of elements for this item. |
0 | On success. | |
< | 0 RTDB_POINTNOTFOUND or RTDB_NOTINCVT |
int ccurRTDB_getAlternateValueP | ( | const RTDBItem * | p, | |
ItemValueDef * | value | |||
) |
Return the alternate value of an RTDB item by address.
p | The address of the RTDB item. | |
value | Pointer to an ItemValueDef where the value is stored. The array of values is allocated by this call (malloc) if value.numElements == 0 or < meta.numElements, otherwise it is assumed that the array pointed to by value->value.Val.Array has already been allocated by the caller and is large enough to hold the item values. It is the responsibility of the caller to free this array when no longer needed. When preallocating the array value->value.numMallocedElements should be set to the number of elements for this item. |
0 | On success. | |
< | 0 RTDB_POINTNOTFOUND |
int ccurRTDB_getAlternateValuePScalar | ( | const RTDBItem * | p, | |
ItemValueDefScalar * | value, | |||
int | index | |||
) |
Return the alternate value of a scalar RTDB item by address.
p | The address of the RTDB item. | |
value | Pointer to an ItemValueDef where the value is stored. | |
index | The element value to return when this RTDB item is defined as an array. Use 0 for items that are defined as scalars. |
0 | On success. | |
< | 0 RTDB_POINTNOTFOUND |
int ccurRTDB_getAlternateValue | ( | const char * | pointName, | |
ItemValueDef * | value | |||
) |
Return the alternate value of an RTDB item by name.
pointName | The name of the RTDB item. | |
value | Pointer to an ItemValueDef where the value is stored. The array of values is allocated by this call (malloc) if value.numElements == 0 or < meta.numElements, otherwise it is assumed that the array pointed to by value->value.Val.Array has already been allocated by the caller and is large enough to hold the item values. It is the responsibility of the caller to free this array when no longer needed. When preallocating the array value->value.numMallocedElements should be set to the number of elements for this item. |
0 | On success. | |
< | 0 RTDB_POINTNOTFOUND |
int ccurRTDB_setCVTValue | ( | const char * | pointName, | |
ItemValue * | value | |||
) |
Set the value for RTDB item pointName in the cvt table.
pointName | the name of the RTDB item. | |
value | pointer to the value for the item. |
0 | On success. | |
< | 0 RTDB_POINTNOTFOUND or RTDB_NOTINCVT |
Set the value for an RTDB item given by address in the cvt table.
p | Pointer to the RTDB item. | |
value | pointer to the value for the item. |
0 | On success. | |
< | 0 RTDB_POINTNOTFOUND or RTDB_NOTINCVT |
Set the alternate value for RTDB item given its address.
p | Pointer to the RTDB item. | |
value | pointer to the value for the item. |
0 | If set successfully. | |
< | 0 RTDB_POINTNOTFOUND or RTDB_NOSTRINGVAR |
int ccurRTDB_setAlternateValue | ( | char * | pointName, | |
ItemValue * | value | |||
) |
Set the alternate value for RTDB item pointName.
pointName | Name of the RTDB item. | |
value | pointer to the value for the item. |
0 | If set successfully. | |
< | 0 RTDB_POINTNOTFOUND or RTDB_NOSTRINGVAR |
Set the value for RTDB item by address. Only numeric value can be stored with this call.
If the item is not defined in the CVT. It will be stored in the alternate value.
If it is an INPUT point, it goes in the CVT since when overridden the I/O value goes in the alternate value. If it is OUTPUT point, it goes in the alternate value if the CVT value has been overridden (RTDBFL_ALTVALUE is set) and alternate is the value used to do the physical output.
p | The address of the RTDB item. | |
value | pointer to the value for the item. |
0 | If set successfully. | |
< | 0 RTDB_POINTNOTFOUND, RTDB_NOSTRINGVAR |
int ccurRTDB_setAlternateFlag | ( | const char * | pointName, | |
int | enable | |||
) |
Set/Reset the Item Alternate flag.
pointName | The name of the RTDB item. | |
enable | True to set the flag , false to reset the flag |
0 | If set successfully. | |
< | 0 RTDB_POINTNOTFOUND On failure. |
int ccurRTDB_setAlternateFlagP | ( | RTDBItem * | pItem, | |
int | enable | |||
) |
Set/Reset the Item Alternate flag.
pItem | The address of the RTDB item. | |
enable | True to set the flag , false to reset the flag |
0 | If set successfully. | |
< | 0 RTDB_POINTNOTFOUND On failure. |
int ccurRTDB_setOperatorFlag | ( | const char * | pointName, | |
int | enable | |||
) |
Set/Reset the Item operator flag.
pointName | The name of the RTDB item. | |
enable | True to set the flag , false to reset the flag |
0 | If set successfully. | |
< | 0 RTDB_POINTNOTFOUND On failure. |
int ccurRTDB_setOperatorFlagP | ( | RTDBItem * | pItem, | |
int | enable | |||
) |
Set/Reset the Item operator flag.
pItem | The address of the RTDB item. | |
enable | True to set the flag , false to reset the flag |
0 | If set successfully. | |
< | 0 RTDB_POINTNOTFOUND On failure. |
int ccurRTDB_getNumberOfItems | ( | void | ) |
Return the number of RTDB items defined in the data base.
The | number of RTDB items that exist in the currently loaded RTDB. |
int ccurRTDB_getMaxNumberOfItems | ( | void | ) |
Return the maximum number of RTDB items that can be stored in the RTDB.
The | maximum number of RTDB items that are loaded in the RTDB. |
int ccurRTDB_getMaxNumberOfStrings | ( | void | ) |
Return the maximum number of string RTDB items that can be stored in the RTDB.
The | maximum number of string RTDB items that are loaded in the RTDB. |
double ccurRTDB_getFrameRate | ( | void | ) |
Return the frame rate in Hz the simulator is running at. This is the inverse of the frame length returned by ccurRTDB_getFrameLength .
The | frame rate. |
void ccurRTDB_setFrameLength | ( | int | frameLength | ) |
Set the frame length in micro seconds for this test (This is set by the scheduler when starting a test).
int ccurRTDB_getFrameLength | ( | void | ) |
Return the frame duration in micro seconds. This is set by the scheduler process at test start up and is defined by the parameters specified when the particular test session was created.
The | length of the frame in micro seconds. |
unsigned int ccurRTDB_getFrameCount | ( | ) |
Return the current frame count of the running test.
The | value current frame count. |
void ccurRTDB_incrementFrameCount | ( | ) |
Increment the frame count of the running test.
void ccurRTDB_setFrameCount | ( | unsigned int | frameCount | ) |
Set the frame count of the currently running.
frameCount | The value of the frame count to set. |
void ccurRTDB_setRunning | ( | int | running | ) |
Set the simulator running flag to to running.
running | : 1 the scheduler has initialized, 2 the test is running This call does not start the test by itself. It simply sets a flags to indicate that a test is currently running. |
void ccurRTDB_setStopped | ( | ) |
Set the Simulator running flag to stop. This does not stop the test.
int ccurRTDB_isRunning | ( | ) |
Return whether a test is currently running.
0 | for stopped | |
10 | for initializing | |
20 | for initialization complete | |
30 | for running | |
4 | for init script | |
5 | for I/O shutdown | |
6 | for test post-processing |
unsigned long long ccurRTDB_testGetStartTimeStamp | ( | ) |
Return TSC time stamp for beginning of test run.
The | time stamp as an unsigned long long. |
int ccurRTDB_getItemMeta | ( | const char * | pointName, | |
RTDBItemMeta * | meta | |||
) |
Return the meta data descriptor for a RTDB item
pointName | the name of the RTDB item | |
meta | Pointer to a RTDBItemMeta where the routine stores the meta data. |
0 | On success. | |
< | 0 RTDB_POINTNOTFOUND On failure. |
int ccurRTDB_setItemMeta | ( | const char * | pointName, | |
RTDBItemMeta * | meta | |||
) |
Set the item meta data.
pointName | The name of the item for which to set the meta data. | |
meta | Pointer to a RTDBItemMeta where the routine stores the meta data. |
0 | On success. | |
< | 0 RTDB_POINTNOTFOUND On failure. |
int ccurRTDB_setLoggingFlagP | ( | RTDBItem * | pItem | ) |
Set the logging flag for the item.
Only RTDB items with the logging flag enabled can be logged at run time. Not to be confused with logging enable call which can toggle the logging at run time and thus turn logging on and off during a run. This call and ccurRTDB_resetLoggingFlag call can only be used during a script initialization phase. Items which do not have the logging flag set via this call or by configuring their logging behavior in the RTDB will never be logged during a run.
pItem | Pointer to the item on which we set the logging flag. |
0 | On success. | |
< | 0 RTDB_POINTNOTFOUND On failure. |
int ccurRTDB_setLoggingFlag | ( | const char * | pointName | ) |
Set the logging flag for the item.
Only RTDB items with the logging flag enabled can be logged at run time. Not to be confused with logging enable call which can toggle the logging at run time and thus turn logging on and off during a run. This call and ccurRTDB_resetLoggingFlag call can only be used during a script initialization phase. Items which do not have the logging flag set via this call or by configuring their logging behavior in the RTDB will never be logged during a run.
pointName | The name of the RTDB item on which we set the logging flag. |
0 | On success. | |
< | 0 RTDB_POINTNOTFOUND On failure. |
int ccurRTDB_resetLoggingFlagP | ( | RTDBItem * | pItem | ) |
Reset the logging flag for the item. Only RTDB items with the logging flag enabled will be logged at run time. Not to be confused with logging enable which can toggle the logging of an item at run time and thus turn logging on and off during a run.
pItem | Pointer to the item on which we reset the logging flag. |
0 | On success. | |
< | 0 RTDB_POINTNOTFOUND On failure. |
int ccurRTDB_resetLoggingFlag | ( | const char * | pointName | ) |
Reset the logging flag for the item. Only RTDB items with the logging flag enabled will be logged at run time. Not to be confused with logging enable which can toggle the logging of an item at run time and thus turn logging on and off during a run.
pointName | The name of the RTDB item on which we reset the logging flag. |
0 | On success. | |
< | 0 RTDB_POINTNOTFOUND On failure. |
int ccurRTDB_setLoggingFlagAll | ( | void | ) |
Set the logging flag for all the items in the RTDB.
0 | always. |
int ccurRTDB_setLoggingEnable | ( | const char * | pointName, | |
char | enable | |||
) |
Toggle the dynamic logging flag for the specified point name.
This flag is automatically toggled at initialization for all points which are to be logged. I.e. those that have the logging flag on.
pointName | The name of the RTDB item on which we set the logging flag. | |
enable | If true, the point values will be logged. When false, logging is disabled. |
0 | On success. | |
-1 | RTDB_POINTNOTFOUND On failure . |
int ccurRTDB_setLoggingEnableP | ( | RTDBItem * | pItem, | |
char | enable | |||
) |
Toggle the dynamic logging flag for the item whose address is supplied.
This flag is automatically toggled at initialization for all points which are to be logged. I.e. those that have the logging flag on.
pItem | Pointer to the RTDB item on which we set the logging flag. | |
enable | If true, the point values will be logged. When false, logging is disabled. |
0 | On success. | |
< | 0 RTDB_POINTNOTFOUND On failure. |
int ccurRTDB_resetToDefault | ( | ) |
Reset all RTDB items in the database to their default value.
0 |
int ccurRTDB_setRTDBInitialConditionValues | ( | void | ) |
Set all RTDB items in the database to their initial condition value as determined by the initial condition set defined for the test.
0 | No error | |
-1 | if error opening the initial condition file. |
int ccurRTDB_setRTDBInitCondLogging | ( | void | ) |
Set all logging enable/disbale defined by the initial condition set defined for the test.
0 | No error | |
-1 | if error opening the initial condition file. |
int ccurRTDB_setRTDBShutDownValues | ( | void | ) |
Set all RTDB items in the database to their shutdown values as determined by the initial condition set called ShutDown defined for the test.
0 | No error | |
-1 | if error opening the initial condition file. |
int ccurRTDB_getDBMetaInfo | ( | RTDBMetaInfo * | p | ) |
Get a copy of the RTDB meta information structure
p | Pointer to RTDBMetaIndo structure where the information is returned. |
0 | When successful. | |
< | 0 RTDB_NOTMAPPED if the RTDB is not mapped in the caller addressing space. |
int ccurRTDB_isDBLoaded | ( | ) |
Check whether the RTDB has been loaded from file.
1 | If a DB is loaded in memory. | |
0 | If a DB is not loaded in memory. |
void ccurRTDB_setDBLoaded | ( | int | b | ) |
Set a DB is loaded in memory.
b | boolean that indicates whether a RTDB is loaded into shared memory. |
void ccurRTDB_setDBName | ( | const char * | dbName | ) |
Set the name of the RTDB that is loaded into memory.
dbName | NULL terminated string with the name of RTDB. |
void ccurRTDB_setDBOffset | ( | const char * | dbName, | |
int | offset | |||
) |
Set the byte offset where this RTDB is loaded.
dbName | NULL terminated string with the name of RTDB. | |
offset | integer with the offset for the RTDB. |
int ccurRTDB_getDBOffset | ( | const char * | dbName | ) |
Get the byte offset where this RTDB is loaded.
dbName | NULL terminated string with the name of RTDB. |
int ccurRTDB_isDBNameLoaded | ( | const char * | dbName | ) |
Return whether this RTDB has already been loaded.
dbName | NULL terminated string with the name of RTDB. |
int ccurRTDB_setBoardDB | ( | int | boardId, | |
int | boardNum, | |||
const char * | dbName | |||
) |
Set the name of the RTDB where the hardwarerecord for this boardId and board instance was found.
boardId | The boardId. | |
boardNum | The board instance. | |
dbName | NULL terminated string with the name of RTDB. |
const char* ccurRTDB_getBoardDB | ( | int | boardId, | |
int | boardNum | |||
) |
Return the name of the RTDB corresponding to this boardId and board instance.
boardId | The boardId. | |
boardNum | The board instance. |
void ccurRTDB_setDBDescription | ( | const char * | dbDescription | ) |
Set the data base description for the RTDB loaded into memory .
dbDescription | A NULL terminated string with the text for the RTDB description/comments. |
void ccurRTDB_setDBCheckSum | ( | unsigned int | cks | ) |
Set the data base checksum value.
cks | value of the calculated checksum for the RTDB. |
unsigned int ccurRTDB_getDBCheckSum | ( | void | ) |
Get the checksum value of the currently loaded RTDB. This value is calculated at startup time by the scheduler process when reading in the RTDB file signal.db
void ccurRTDB_setTestSession | ( | const char * | testId, | |
const char * | sessionId | |||
) |
Set the the test and session id for the currently running test
testId | NULL terminated string with the test id. | |
sessionId | NULL terminated string withe the session id. |
void ccurRTDB_setSnapshotConfig | ( | const char * | snapshotNameTemplate, | |
int | snapshotFormat, | |||
int | snapshotMask, | |||
const char * | snapshotNameMask | |||
) |
Set the the RTDB snapshot configuration for the running test. This is set by the scheduler when loading the test.
snapshotNameTemplate | Template name for the snapshot file name. | |
snapshotFormat | The format to save the snapshot in. One of CAPTURE_CSV, CAPTURE_MAT,etc. | |
snapshotMask | A mask of SNAPSHOT)PARAMETERS, SNAPSHOT_SIGNALS, etc to select what type of RTDB items to write to the file. | |
snapshotNameMask | A regular expression matching the name of the items to write to the file. |
void ccurRTDB_getTestSession | ( | char * | testId, | |
char * | sessionId | |||
) |
Get the the test and session id for the currently running test.
testId | Buffer address then the test id is returned. | |
sessionId | Buffer address then the session id is returned. |
void ccurRTDB_getSnapshotConfig | ( | char * | snapshotNameTemplate, | |
int * | snapshotFormat, | |||
int * | snapshotMask, | |||
char * | snapshotNameMask | |||
) |
Get the the RTDB snapshot configuration for the running test.
snapshotNameTemplate | Template name for the snapshot file name. | |
snapshotFormat | The format to save the snapshot in. One of CAPTURE_CSV, CAPTURE_MAT,etc. | |
snapshotMask | A mask of SNAPSHOT)PARAMETERS, SNAPSHOT_SIGNALS, etc to select what type of RTDB items to write to the file. | |
snapshotNameMask | A regular expression matching the name of the items to write to the file. |
void ccurRTDB_setTestInitCondition | ( | const char * | initCondName | ) |
Set the the test initial conditions set name.
initCondName | NULL terminated string with the initial conditions name. |
void ccurRTDB_getTestInitCondition | ( | char * | initCondName | ) |
Get the the test initial conditions set name.
initCondName | NULL terminated string with the initial conditions name. |
void ccurRTDB_resumeDLogger | ( | ) |
Resume the Data logger client.
void ccurRTDB_pauseDLogger | ( | ) |
Pause the Data logger client.
void ccurRTDB_newItemDLogger | ( | int | newHashIndex, | |
char * | oldName | |||
) |
Notify the Data logger that a spare item has been renamed.
void ccurRTDB_stopCircularLogger | ( | ) |
Stop the crash loop circular logger. Once it has been stopped, this circular logger cannot be restarted.
int ccurRTDB_isDLoggerRunning | ( | ) |
Check whether the data logger client is running.
1 | if the data logger is running | |
0 | if the data logger is not running. We might be in playback mode. |
int ccurRTDB_isCLoggerRunning | ( | ) |
Check whether the circular logger is running. By default the circular logger is always running until stopped.
1 | if the circular data logger is running | |
0 | if the circular data logger is not running. We might be in playback mode. |
void ccurRTDB_setCircularLoggerLockBehavior | ( | int | behavior | ) |
Set how the data logger is to behave with respect to treating locking of circular logger files.
behavior | Behavior for the data logger lock. One of CIRCLOGGER_XXX |
int ccurRTDB_getCircularLoggerLockBehavior | ( | void | ) |
Get the behavior of the data logger locking of circular logger files.
integer | with lock behavior. One of CIRCLOGGER_XXX. |
void ccurRTDB_setDataLoggerDirectIO | ( | int | directIO | ) |
Set whether to do direct I/O in the data logger. When direct I/O is set (the default). The data logger buffers around 1 second of data before writing to disk. This means that the data is no available until after the buffers have filled and have been flushed. When direct I/O is not on, the O/S buffers the write to disk and this might end up consuming a lot of system memory.
void ccurRTDB_getDBName | ( | char * | dbName | ) |
Returns the data base name that is currently loaded.
dbName | string pointer where the DB name is placed. |
int ccurRTDB_getItemList | ( | RTDBItemPairPtr * | list, | |
int * | n, | |||
int | pointType, | |||
const char * | pattern | |||
) |
Return a list of RTDB <name,pointer> pairs where the item name matches the regular expression pattern.
list | Pointer to a RTDBItemPairPtr where to store the list of items. This is allocated by the call. | |
n | Pointer to an integer variable where the number of items matching the pattern is returned. | |
pointType | The type of point to match against, i.e. RTDBAI or -1 to match any point type. | |
pattern | A regular expression pattern to match the item name against. e.g. "^I.*" to get all the items beginning with 'I'. This is a deprecated parameter and is not used anymore, it is kept in here to maintain the method signature. |
0 | On success. |
const char* ccurRTDB_getItemName | ( | const RTDBItem * | p | ) |
Get the name of the RTDB item .
p | The address of the RTDB item for which we want the name. |
A | pointer to the item name On success. | |
NULL | if the item cannot be found in the RTDB item table. |
int ccurRTDB_getItemAddress | ( | const char * | name, | |
RTDBItem ** | p | |||
) |
Get the address of the RTDB item name
name | The name of the item to get the address of | |
p | The address of the RTDB item is returned here if the call is successful. |
0 | On success. | |
< | 0 If the point could not be found; RTDB_POINTNOTFOUND. |
void* ccurRTDB_getItemCVTValueAddress | ( | const char * | name | ) |
Get the address of the item value in the CVT table.
The pointer can be derefenced if the user knows the datatype (i.e. char,float.double,etc.) of the RTDB item.
// Sample code double *pVal = curRTDB_getItemCVTValueAddress("autotrans_demo.SWthrottle"); if (pVal == NULL) { Log_Error("Can't find RTDB item 'autotrans_demo.SWthrottle'\n"); return -1; } // Assuming that autotrans_demo.SWthrottle is defined as a CVT type 'double' double throttle = *pVal;
name | The name of the item to get the address of |
NULL | On error if the item name cannot be found. | |
The | address of the CVT value. |
void* ccurRTDB_getItemAltValueAddress | ( | const char * | name | ) |
Get the address of the item value in the Alternate value table.
The pointer can be derefenced if the user knows the datatype (i.e. char,float.double,etc.) of the RTDB item.
// Sample code double *pVal = ccurRTDB_getItemAltValueAddress("autotrans_demo.SWthrottle"); if (pVal == NULL) { Log_Error("Can't find RTDB item 'autotrans_demo.SWthrottle'\n"); return -1; } // Assuming that autotrans_demo.SWthrottle is defined as a CVT type 'double' double throttle = *pVal;
name | The name of the item to get the address of |
NULL | On error if the item name cannot be found. | |
The | address of the alternate value. |
int ccurRTDB_regexItemAddress | ( | const char * | regex, | |
RTDBItem ** | p, | |||
char * | name | |||
) |
Get the address of the RTDB item matching regular expression regex.
The matching is case-sensitive. See the manpage for regex(7).
regex | The regular expression to match item names against. | |
p | The address of the RTDB item when a unique match is found. | |
name | When not NULL, buffer to hold the item name when found. |
>=0 | number of matched items. | |
-1 | regex compile/match error (see cfgsrv.log for details). | |
<-1 | Error code corresponding to an internal API call failure. |
int ccurRTDB_globItemAddress | ( | const char * | glob, | |
RTDBItem ** | p, | |||
char * | name | |||
) |
Get the address of the RTDB item matching a glob pattern.
The matching is case-sensitive. See the manpage for glob(7).
glob | The glob pattern to match item names against. | |
p | The address of the RTDB item when a unique match is found. | |
name | When not NULL, buffer to hold the item name when found. |
>=0 | number of matched items. | |
-1 | pattern matching error (see cfgsrv.log for details). | |
<-1 | Error code corresponding to an internal API call failure. |
int ccurRTDB_getHardwareConfigAddress | ( | const char * | name, | |
HardwareConfig ** | p | |||
) |
Get the address of the hardware mapping record /
name | The name of the record to get the address of. | |
p | The address of the Hardware Config record is returned here if the call is successful. |
0 | On success. | |
< | 0 If the record could not be found; RTDB_POINTNOTFOUND. |
int ccurRTDB_getEUConversionAddress | ( | const char * | name, | |
EUConversion ** | p | |||
) |
Get the address of the EU conversion record record /
name | The name of the EU conversion record to get the address of. | |
p | The address of the EU conversion record is returned here if the call is successful. |
0 | On success. | |
< | 0 If the EU record could not be found; RTDB_POINTNOTFOUND. |
int ccurRTDB_resolveIOMappings | ( | const char * | name, | |
RTDBItem * | pItem, | |||
char * | errString | |||
) |
Resolve the I/O mappings for the given items. The name of the mapped hardware records is in meta.HardwareRecord[]. This will free the memory allocate for the record name and also reserve memory for the raw values by setting a value to RTDBItemMEta.rawOffset[].
name | The name of the item since it is not in the RTDBItemMeta and we need to print an error message. | |
pItem | Pointer to the item for which to resolve the mappings. | |
errString | pointer where the error message is returned. |
0 | No error, all the I/O mappings for the item were resolved successfully. | |
-1 | On error. The hardware record name could not be resolved or the pointer to the item is null. |
int ccurRTDB_resolveEUConversion | ( | const char * | name, | |
RTDBItem * | pItem, | |||
char * | errString | |||
) |
Resolve the EU conversion from name to hash index for the given item. This will free the memory allocate for the record name.
name | The name of the item since it is not in the RTDBItemMeta and we need to print an error message. | |
pItem | Pointer to the item for which to resolve the EU conversion. | |
errString | pointer where the error message is returned. |
0 | No error, all the EU conversion record for the item was resolved successfully. | |
-1 | On error. The EU conversion record name could not be resolved or the pointer to the item is null. |
int ccurRTDB_getItemIndex | ( | const char * | name | ) |
Get the hash table index of the named RTDB item
name | The name of the item to get the address of |
>= | 0 The hash index On success. | |
-1 | if the named item was not found. |
int ccurRTDB_getHardwareConfigIndex | ( | const char * | name | ) |
Get the hash table index of the named Hardware Config Record item
name | The name of the item to get the address of |
>= | 0 The hash index On success. | |
-1 | if the named record was not found. |
RTDBItem* ccurRTDB_itemIndexToAddress | ( | int | index | ) | [inline] |
Return the address of a RTDB item given its hash table index.
This is useful to pass item reference between applications with different address space. The index of an item is immutable in the RTDB but the address of the item is not because it belongs to the process address space.
index | The hash table index of the item. |
The | address of the item. |
HardwareConfig* ccurRTDB_hardwareConfigIndexToAddress | ( | int | index | ) | [inline] |
Return the address of a HardwareConfig record given its hash table index.
This is usefully to pass item reference between applications with different address space. The index of an item is immutable in the RTDB but the address of the item is not because it belongs to the process address space.
index | The hash table index of the item. |
The | address of the HardwareConfig record. |
void ccurRTDB_setLoggedUser | ( | const char * | userName | ) |
Set the name of the logged user that is starting a test.
userName | Pointer to the user name |
None |
const char* ccurRTDB_getLoggedUser | ( | void | ) |
Return the name of the logged user.
Pointer | to the logged user name. |
void ccurRTDB_scriptInitStdIO | ( | void | ) |
Initialize the Script standard IO shared memory.
ScriptStdIO* ccurRTDB_getScriptStdIOAddress | ( | void | ) |
Return the address in the caller's address of the Script standard IO shared memory.
The | address of the Script shared memory. |
int ccurRTDB_writeStdOut | ( | char * | str | ) |
Write data to the script pseudo standard out.
str | Character buffer where to output. |
Always | returns 0 |
double ccurRTDB_euPhysicalToRaw | ( | RTDBItemMeta * | meta, | |
double | euValue | |||
) | [inline] |
Convert a value from physical engineering units to raw value.
meta | Pointer to the RTDBItemMeta for the item. | |
euValue | the physical value to convert to raw units. |
The | converted value. |
double ccurRTDB_euRawToPhysical | ( | RTDBItemMeta * | meta, | |
double | rawValue | |||
) | [inline] |
Convert a value from raw units to physical engineering units .
If the conversion cannot be inverted because the polynomial conversion is non linear, euConversionError is set and the rawValue is returned.
meta | Pointer to the RTDBItemMeta for the item. | |
rawValue | the raw value to convert. |
The | converted value. |
int ccurRTDB_asyncGetLastRXIntervalP | ( | const RTDBItem * | pItem | ) |
Returns the interval in micro seconds between the last 2 updates of the point into the RTDB.
This is only valid for input points mapped to asynchronous devices such as ARINC 429 or AFDX.
It is used to check that the transmitting device is transmitting at a regular interval.
int ccurRTDB_asyncGetLastRXInterval | ( | const char * | pointName | ) |
Returns the interval in micro seconds between the last 2 updates of the point into the RTDB.
This is only valid for input points mapped to asynchronous devices such as ARINC 429 or AFDX.
It is used to check that the transmitting device is transmitting at a regular interval.
int ccurRTDB_asyncGetTimeSinceLastRXP | ( | const RTDBItem * | pItem | ) |
Returns the number of micro seconds elapsed since the specified data point was last updated in the RTDB.
This is only valid for input points mapped to asynchronous devices such as ARINC 429 or AFDX.
It is used to check that the transmitting device has not timed out.
int ccurRTDB_asyncGetTimeSinceLastRX | ( | const char * | pointName | ) |
Returns the number of micro seconds elapsed since the specified data point was last updated in the RTDB.
This is only valid for input points mapped to asynchronous devices such as ARINC 429 or AFDX.
It is used to check that the transmitting device has not timed out.
unsigned long long ccurRTDB_asyncGetRXTimeStampP | ( | const RTDBItem * | pItem | ) |
Returns the time stamp in hardware ticks (_rdtsc()) when the last update on the point took place.
This is only valid for input points mapped to asynchronous devices such as ARINC 429 or AFDX.
void ccurRTDB_formImport | ( | const char * | formName, | |
char | inputsOnly | |||
) |
Import the values defined in a form into the RTDB of a running test.
formName | The name of the form. | |
inputsOnly | If non-zero, only set the values of items defined as input |
int ccurRTDB_formCapture | ( | const char * | formName, | |
const char * | nameTemplate, | |||
int | captureType, | |||
double | period, | |||
int | runCount | |||
) |
Capture values of RTDB items and save to a file. The set of items is defined by the RTViewer form name.
formName | The name of the form that defines the items to be captured. | |
nameTemplate | A template to form the name of the capture file. The template can contains predefined tokens such as: $testname $sessionname $formname $date $time $framecount $seqnum | |
captureType | Define the format to write the capture file: one of (0 == CSV, 1 == Initial Condition, 2 == RTForm, 3 == MAT file) | |
period | The period in seconds when capturing multiple records, only apply for CSV. | |
runCount | The number of records to capture , only apply for CSV. |
void ccurRTDB_snapshot | ( | void | ) |
Take a snapshot of the RTDB loaded in memory.
Group of items can be selected. See Control Center documentation for more info
int ccurRTDB_addUnit | ( | int | uClass, | |
const char * | name, | |||
double | A, | |||
double | B | |||
) |
Add a Unit to the database.
uClass | The unit class. | |
name | The unit name. | |
A | The A conversion factor to convert to the base unit of the class. | |
B | The B conversion factor to convert to the base unit of the class. |
>=0 | The index in RTDB of the newly allocated item. | |
< | 0 On failure |
int ccurRTDB_mapModelCVT | ( | const char * | pgmName, | |
void * | cvtTable, | |||
int | cvtSize | |||
) |
Map a user Model CVTTABLE struct at the offset at which it has been loaded. This applies when multiple RTDB's are loaded by the scheduler.
Group of items can be selected. See Control Center documentation for more info
pgmName | String with the user model name. Usually argv[0] from the command line. | |
cvtTable | The address of the CVTTable struct. | |
cvtSize | The size of the CVTTable struct |
int ccurRTDB_modelDataExchangeInit | ( | const char * | modelName | ) |
Initialize the data structure necessary to support model data exchange.
modelName | String with the user model name. Usually argv[1] from the command line. |
void ccurRTDB_modelCopyInputs | ( | void | ) |
Copy the output variables from other models to this model's inputs. This call should be placed in the simulation loop after the ccurSched_waitNextFrame() call. This call will perform unit conversion between the output items from other models and inputs into this model. If model exchange has not been configured for this model, nothing happens and this call returns immediately.