Adm api database functions – ProSoft Technology MVI69-ADM User Manual
Page 132

Application Development Function Library - ADM API
MVI-ADM ♦ 'C' Programmable
Developer's Guide
'C' Programmable Application Development Module
Page 132 of 342
ProSoft Technology, Inc.
February 20, 2013
7.4
ADM API Database Functions
ADM_DBOpen
Syntax
int ADM_DBOpen(ADMHANDLE adm_handle, unsigned short max_size)
Parameters
adm_handle
Handle returned by previous call to ADM_Open
max_size
Maximum number of words in the database
Description
This function creates a database in the RAM area of the MVI-ADM module.
adm_handle must be a valid handle returned from ADM_Open.
MVI94 Note: The maximum number of database registers in the MVI94 is limited to 3996.
MVI56 Note: The maximum number of database registers in the MVI56 is limited to 7000.
MVI46 Note: The maximum number of database registers in the MVI46 is limited to 10000.
Return Value
ADM_SUCCESS
No errors were encountered
ADM_ERR_NOACCESS
adm_handle does not have access
ADM_ERR_DB_MAX_SIZE
max_size has exceeded the maximum allowed
ADM_ERR_REG_RANGE
max_size requested was zero
ADM_ERR_OPEN
Database already created
ADM_ERR_MEMORY
Insufficient memory for database
Example
ADMHANDLE adm_handle;
if(ADM_DBOpen(adm_handle, ADM_MAX_DB_REGS) != ADM_SUCCESS)
printf("Error setting up Database!\n");
See Also
ADM_DBClose (page 133)