EasyManuals Logo

Moxa Technologies NPort 5219A User Manual

Moxa Technologies NPort 5219A
194 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #165 background imageLoading...
Page #165 background image
NPort 5000 Series User Manual
165
MxNPortAPI Function Groups
The supported functions in this API are listed below:
Port Control
Input/Output
Port Status Inquiry
Miscellaneous
open
close
setIoctlMode
setFlowCtrl
setBaud
setRTS
setDTR
flush
read
write
getBaud
getFlowCtrl
getIoctlMode
getLineStatus
getModemStatus
getOQueue
setBreak
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 {
byte[] buf = {'H','e','l','l','o',' ','W','o','r','l','d'};
mxNPort.open(); /*open port*/
mxNPort.setIoctlMode(mode); /*serial parameters setting*/
mxNPort.write(buf, buf.length); /*write data*/
mxNPort.close(); /*close port*/
} catch (MxException e){
/*Error handling*/
}
}
}
};
thread.start();

Table of Contents

Other manuals for Moxa Technologies NPort 5219A

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Moxa Technologies NPort 5219A and is the answer not in the manual?

Moxa Technologies NPort 5219A Specifications

General IconGeneral
BrandMoxa Technologies
ModelNPort 5219A
CategoryServer
LanguageEnglish

Related product manuals