Mxnportapi Function Groups; Example Program - Moxa Technologies NPort IA5000A-I/O series User Manual

With digital i/o
Hide thumbs Also See for NPort IA5000A-I/O series:
Table of Contents

Advertisement

NPort IAW5x50A-6I/O
For more details about the installation, please refer to the Overview section.

MxNPortAPI Function Groups

The supported functions in this API are listed below:
Port Control
open
close
setIoctlMode
setFlowCtrl
setBaud
setRTS
setDTR
flush

Example Program

To make sure this API is workable with the device server on an Android platform, see the example program
below:
Thread thread = new Thread()
{
@Override
public void run() {
/* Enumerate and initialize NPorts on system */
List<MxNPort> NPortList = MxNPortService.getNPortInfoList();
if(NPortList!=null){
MxNPort.IoctlMode mode = new MxNPort.IoctlMode();
mode.baudRate = 38400;
mode.dataBits = MxNPort.DATA_BITS_8;
mode.parity = MxNPort.PARITY_NONE;
mode.stopBits = MxNPort.STOP_BITS_1;
MxNPort mxNPort = NPortList.get(0); /* Get first NPort device */
try {
Input/Output
read
write
13-3
Android API Instructions
Port Status Inquiry
getBaud
getFlowCtrl
getIoctlMode
getLineStatus
getModemStatus
getOQueue
Miscellaneous
setBreak

Advertisement

Table of Contents
loading

This manual is also suitable for:

Nport iaw5000a-i/o series

Table of Contents