Prosoft-technology MVI56E-LDM Manual do Utilizador Página 55

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 264
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 54
ControlLogix Platform "C" Programmable Understanding the MVI56-LDM API
Linux Application Development Module Developer's Manual
ProSoft Technology, Inc. Page 49 of 264
March 12, 2014
4.12 Serial Sample
To run the Serial sample:
1 Open a command window using telnet or a similar terminal software on the
PC through a serial (P1) or Ethernet port.
2 Login as user: root, password: password.
The second serial port (P2) will be used for the communication sample.
To execute the sample:
1 From the default home directory /psft, type the command ./Serial_Sample&.
The program runs as a background task.
While looking at the sample source, you'll see that the following occurs:
register sigquit_handler for four signals
check command line and print usage message if required
open the backplane using open_backplane()
Read the serial configuration jumpers and make sure that the second serial
port is configured for RS232.
Open the serial port using the open_serial_port() function.
Opens the serial device by calling open()
Reads current serial port attributes using tcgetaddr()
Configures serial port attributes. cfsetispeed() and cfsetispeed() set the
baud rate. tcsetattr() is then used to set the remaining attributes.
Initialize LEDs on the front panel
Changes the front panel display to "Run"
Enters a for loop which transmits a test string one character at a time by
calling write() and then sleeping for 500 msec using OCXcip_Sleep()
Closes the serial driver connection using close().
Vista de página 54
1 2 ... 50 51 52 53 54 55 56 57 58 59 60 ... 263 264

Comentários a estes Manuais

Sem comentários