NPort 5600 Series User’s Manual

Pinouts and Cable Wiring

IP Serial LIB Function Groups

Server Control

nsio_init nsio_end nsio_resetserver nsio_checkalive

Port Control

Input/Output Data

Port Status

Miscellaneous

nsio_open

nsio_read

Inquiry

 

nsio_lstatus

nsio_break

nsio_close

nsio_SetReadTimeouts

nsio_data_status

nsio_break_on

nsio_ioctl

nsio_write

 

nsio_break_off

nsio_flowctrl

nsio_SetWriteTimeouts

 

nsio_breakcount

nsio_DTR

 

 

 

nsio_RTS

 

 

 

nsio_lctrl

 

 

 

nsio_baud

 

 

 

nsio_resetport

 

 

 

Example Program

char nportip=”192.168.1.10”;

 

char buffer[255];

/*data buffer, 255 chars */

int port = 1;

/*1st port */

int portid;

/* port handle */

nsio_init();

/*initial IP Serial Library */

portid = nsio_open(nportip, port);

/*1st port, nport IP=192.168.1.10 */

nsio_ioctl(portid, B9600, (BIT_8 STOP_1

/*set 9600, N81 */

P_NONE) );

/* wait for 1000 ms for data */

sleep(1000);

/* read 200 bytes from port 1 */

nsio_read(port, buffer, 200);

/* close this serial port */

nsio_close(portid);

/* close IP Serial Library */

nsio_end();

 

7-3

Page 98
Image 98
Moxa Technologies NPort 5600 user manual IP Serial LIB Function Groups, Example Program, Server Control, Inquiry