Moxa Technologies Moxa Smartio C168H Uživatelský manuál Strana 57

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 84
  • Tabulka s obsahem
  • ŘEŠENÍ PROBLÉMŮ
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 56
Serial Programming Tools
Smartio C168H/PCI User’s Manual 4-7
sio_SetWriteTimeouts(port, 0); /* Set sio_write() into block mode */
sio_RTS(port, 1); /* Turn on RTS signal. The RS-485 port is
ready for
transmitting data. */
sio_write(port, buff, 10); /* Write 10 byte characters in "buff". The
function
blocks until last character transmitted */
sio_RTS(port, 0); /* Turn off RTS signal. The RS-485 port is
ready for receiving data. */
sio_read(port, buff, 10); /* Read 10 bytes */
Solution 2
The PComm library contains a dedicated RS-485 function that integrates the functions
given in solution 1 regarding sending data.
sio_putb_x(port, buff, tick ); /* 1. Turn on RTS ; ready for transmitting data
.
2. Send data.
3. Wait for tick time.
4. Turn off RTS ; ready for receiving data. */
For more information about these functions, refer to the PComm library on-line Help
file for Windows NT and Windows 95/98.
Zobrazit stránku 56
1 2 ... 52 53 54 55 56 57 58 59 60 61 62 ... 83 84

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

Žádné komentáře