Rockwell-automation 2706-DXX Dataliner Message Display DL5 Series Instrukcja Użytkownika Strona 109

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 119
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 108
2706-UM001A-US-P
Appendix D
Application Notes
Unsigned Integer to String
Conversion
Serial protocol uses decimal values in the range of 0 to 65535 to send
variable data (Ctrl-V command). PLCs that do not support unsigned
integers can only generate values in the range of -32768 to 32767. To send
decimal values in the range used by the serial protocol, use the following
ladder logic. This program converts a 16-bit signed integer to an unsigned
ASCII decimal string. The ASCII decimal string can then be used to
generate serial commands for the DL5.
In this example, the 16-bit integer is in N17:0 (signed value = -12264,
unsigned value = 53272). The conversion uses N17:1 and ST18:1-4 as
temporary buffers. The ASCII decimal string is returned in ST18:5. The
conversion routine ladder logic is as follows:
AIC
Integer to String
Source
N17:0
-12264<
Dest ST18:5
GEQ
Grtr Than or Eql (A>=B)
Source A
-12264<
Source B 0
N17:0
0<
0000
AIC
Integer to String
Source
6
6<
Dest ST18:1
LES
Less Than or Eql (A<B)
Source A
-12264<
Source B 0
N17:0
0<
0001
SUB
Subtract
Source A
N17:0
-12264<
Source B -5536
15536<
Dest N17:1
3272<
AIC
Integer to String
Source
5
5<
Dest ST18:1
LES
Less Than or Eql (A<B)
Source A
-12264<
Source B -5536
N17:0
-5536<
0002
SUB
Subtract
Source A
N17:0
-12264<
Source B -15536
-15536<
Dest N17:1
3272<
Przeglądanie stron 108
1 2 ... 104 105 106 107 108 109 110 111 112 113 114 ... 118 119

Komentarze do niniejszej Instrukcji

Brak uwag