ProSoft Technology MVI69-ADM User Manual

Page 62

Advertising
background image

Understanding the MVI-ADM API

MVI-ADM ♦ 'C' Programmable

Developer's Guide

'C' Programmable Application Development Module

Page 62 of 342

ProSoft Technology, Inc.

February 20, 2013

WORD cmd; /* reserved */
WORD err; /* block transfer errors */

}ADM_BLK_ERRORS;

The structure ADM_PORT contains the application port configuration and status
variables.

typedef struct
{

char enabled; /* Y=Yes, N=No */
unsigned short baud; /* port baud rate */
short parity; /* port parity */
short databits; /* number of data bits per character */
short stopbits; /* number of stop bits */
unsigned short MinDelay; /* minimum response delay */
unsigned short RTS_On; /* RTS delay before assertion */
unsigned short RTS_Off; /* RTS delay before de-assertion */
char CTS; /* Y=Yes, N=No */
short state; /* state of comm. Message state machine */
int len; /* length of data in buffer */
int expLen; /* expected length of message */
unsigned long timeout; /* timeout for message */
int ComState; /* State of serial communication */
int RTULen; /* reserved */
unsigned short tm; /* timing variable; used for current time */
unsigned short tmlast; /* time of previous time check */
long tmout; /* timeout time variable */
long tmdiff; /* holds tm - tmlast */
unsigned short CurErr; /* current comm. error */
unsigned short LastErr; /* previous comm. error */
unsigned short CfgErr; /* port configuration error */
unsigned short buff_ptr; /* pointer to current location in buff */
char buff[600]; /* buffer for holding comm. packets */
unsigned char SendBuff[1000]; /* reserved */
unsigned char RecBuff[1000]; /* reserved */

}ADM_PORT;

The structure ADM_MODULE contains the module database configuration
variables.

typedef struct
{

char name[81]; /* module name */
short max_regs; /* number of database registers */
short err_offset; /* address of status table in database */
unsigned short err_freq; /* status table update time in ms */
short rd_start; /* read block start address*/
short rd_count; /* read block register count */
short rd_blk_max; /* maximum number of read blocks */
short wr_start; /* write block starting address */
short wr_count; /* write block register count */
short wr_blk_max; /* maximum number of write blocks */
short bt_fail_cnt; /* number of backplane transfer failures */
/* before ending communications (not used)*/
}ADM_MODULE;

The structure ADM_PORT_ERRORS contains the application port
communication status variables.

Advertising