NPort 5110 Series User’s ManualIP Serial LIB

IP Serial LIB Function Groups

Server Control

Port Control

Input/Output Data

Port Status

Miscellaneous

 

 

 

Inquiry

 

nsio_init

nsio_open

nsio_read

nsio_lstatus

nsio_break

nsio_end

nsio_close

nsio_SetReadTimeouts

nsio_data_status

nsio_break_on

nsio_resetserver

nsio_ioctl

nsio_write

 

nsio_break_off

nsio_checkalive

nsio_flowctrl

nsio_SetWriteTimeouts

 

nsio_breakcount

 

nsio_DTR

 

 

 

 

nsio_RTS

 

 

 

 

nsio_lctrl

 

 

 

 

nsio_baud

 

 

 

 

nsio_resetport

 

 

 

Example Program

char NPort

/*data buffer, 255 chars */

5110-Nip=”192.168.1.10”;

char buffer[255];

/*1st port */

int port = 1;

/* port handle */

int portid;

/*initial IP Serial Library */

nsio_init();

/*1st port, NPort 5110

portid = nsio_open(NPort 5110ip,

IP=192.168.1.10 */

port);

/*set 9600,

N81 */

nsio_ioctl(portid, B9600, (BIT_8 /* wait for

1000 ms for data */

STOP_1 P_NONE) );

/* read 200

bytes from port 1 */

sleep(1000);

/* close this serial port */

nsio_read(port, buffer, 200);

/* close IP Serial Library */

nsio_close(portid);

 

 

nsio_end();

 

 

7-3

Page 85
Image 85
Moxa Technologies 5110 Series user manual IP Serial LIB Function Groups, Example Program