Moxa NPORT 5110-T Uživatelský manuál Strana 84

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 94
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 83
NPort 5100 Series IP Serial LIB
8-3
Example Program
char
NPort 5100-Nip=”192.168.1.10”;
char buffer[255];
int port = 1;
int portid;
nsio_init();
portid = nsio_open(
NPort 5100ip, 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 5100 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 */
Zobrazit stránku 83
1 2 ... 79 80 81 82 83 84 85 86 87 88 89 ... 93 94

Komentáře k této Příručce

Žádné komentáře