Moxa-technologies IA5150 Instrukcja Użytkownika Strona 93

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 108
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 92
NPort IA5150/5250 Series User’s Manual IP Serial LIB
7-3
IP Serial LIB Function Groups
Server Control Port Control Input/Output Data Port Status
Inquiry
Miscellaneous
nsio_init
nsio_end
nsio_resetserver
nsio_checkalive
nsio_open
nsio_close
nsio_ioctl
nsio_flowctrl
nsio_DTR
nsio_RTS
nsio_lctrl
nsio_baud
nsio_resetport
nsio_read
nsio_SetReadTimeouts
nsio_write
nsio_SetWriteTimeouts
nsio_lstatus
nsio_data_status
nsio_break
nsio_break_on
nsio_break_off
nsio_breakcount
Example Program
char NPort IA5150/5250-Nip=”192.168.1.10”;
char buffer[255];
int port = 1;
int portid;
nsio_init();
portid = nsio_open(NPort IA5150/5250ip, port);
nsio_ioctl(portid, B9600, (BIT_8 | STOP_1 | P_NONE) );
sleep(1000);
nsio_read(port, buffer, 200);
nsio_close(portid);
nsio_end();
/*data buffer, 255 chars */
/*1st port */
/* port handle */
/*initial IP Serial Library */
/*1st port, NPort IA5150/5250
IP=192.168.1.10 */
/*set 9600, N81 */
/* wait for 1000 ms for data */
/* read 200 bytes from port 1 */
/* close this serial port */
/* close IP Serial Library */
Przeglądanie stron 92
1 2 ... 88 89 90 91 92 93 94 95 96 97 98 ... 107 108

Komentarze do niniejszej Instrukcji

Brak uwag