beautypg.com

Serial ports – ProSoft Technology MVI69E-LDM User Manual

Page 81

background image

MVI69E-LDM ♦ "C" Programmable

Contents

Linux Application Development Module

Developer's Manual

ProSoft Technology, Inc.

Page 81 of 130

August 21, 2014

5.5

Serial Ports

The API functions in this section can be used to access tag data withing CompactLogix
controllers. The prototypes for most of these functions and their associated data structure
definitions can be found in the header file OCXTagDb.h.

The tag access functions that include "Db" in the name are for use with a valid tag database
(see OCXcip_BuildTagDb ).

MVI69_GetSerialConfig

Syntax

int MVI69_GetSerialConfig (MVI69HANDLE handle,
MVI69SPCONFIG *spconfig);

Parameters

handle

handle returned by previous call to MVI69_Open

spconfig

pointer to structure of type MVI69SPCONFIG

Description
MVI69_GetSerialConfig retrieves the state of the serial port configuration jumper for the port
specified. The information is returned in the structure spconfig.

handle must be a valid handle returned from MVI69_Open.

The MVI69SPCONFIG structure is defined as follows:

typedef struct tagMVI69SPCONFIG
{
int port_num; /* Port number (1 or 2) */
int port_cfg; /* Jumper position */
} MVI69SPCONFIG;

port_num must be set to the desired port before calling this function. Upon return, port_cfg
will be set to one of the following values:

MVI69_SERIAL_CONFIG_NONE (No jumper installed)

MVI69_SERIAL_CONFIG_RS232

MVI69_SERIAL_CONFIG_RS422

MVI69_SERIAL_CONFIG_RS485

Return Value

MVI69_SUCCESS

the configuration information was read successfully

MVI69_ERR_NOACCESS

handle does not have access