Rockwell-automation 5370-CUPK Color CVIM USER-PAK Option Manual de usuario Pagina 122

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 160
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 121
Chapter 8
Defining Strings for Serial Ports and Viewports
8 33
This section provides an example of a serial port message string, for the
purpose of demonstrating the use of string elements, and the definition of the
Event.
For this example, we want to transmit the results of the two gage
measurements, and also to transmit the results only if the inspection fails.
First, determine the format. Suppose we want the message transmitted in the
following format for use by a printer:
Results [space] [ gage 1 result ] [space] [ gage 2 result ] [CR ] [ LF]
where [space] is the space character, [CR] is the carriage return, and [LF] is
the line feed character. A string text entry which would transmit the above
content and format would be:
Results g1(3) g2(3) n
The above string text would look like this on the keyboard display:
String entry display
Transmitted String:
Results 109 112 [CR] [LF]
Assuming these gage results for an inspection Gage 1 = 109, Gage 2 = 112
the resulting string, if transmitted, would be as shown above.
Now lets look at the string elements to see how the message was created:
Literal Text consists of any characters enclosed within a pair of quotes.
Two literal text entries in the string are Results (which includes a
space after the word Results) and (which is a space enclosed in
quotes).
Results 109 112 [CR] [LF]
Note that, as a result of the spaces in the literal entries, spaces exist between
the transmitted fields.
Custom Serial Port
Message Example
Vista de pagina 121
1 2 ... 117 118 119 120 121 122 123 124 125 126 127 ... 159 160

Comentarios a estos manuales

Sin comentarios