|
In this case the string is stored is string memory ST9:0 and has a length of 4 characters. If the string stored in ST9:0 is HALFLIFE, the terminal program will display the string HALF.
PLC5 RS-232 Cable
com 1
Terminal Emulator
channel 0
A
AWT
Channel 0 String Location ST9:0 Length 4
Figure 27.6 Serial Output Using Ladder Logic The AWT (Ascii WriTe) function below will write to serial ports on the CPU only.
plc serial -27.9
To write to other serial ports the message function in Figure 27.7 must be used. In this example the message block will become active when A goes true. It will use the message parameters stored in message memory MG9:0. The parameters set indicate that the message is to Write data stored at N7:50, N7:51 and N7:52. This will write the ASCII string ABC to the serial port.
A MSG Control Block MG9:0
Memory Values: Read/Write Data Table Size Local/Remote
setup stored
Remote Station in MG9:0
Link ID Remote Link type Local Node Addr. Processor Type Dest. Addr.
Data Stored in memory N7:50 N7:51 N7:52 Write N7:50 3 Local N/A N/A N/A 20 ASCII N/A
65
66
67
Figure 27.7 Message Function for Serial Communication
27.2.1.1 -ASCII Functions
ASCII functions allow programs to manipulate strings in the memory of the PLC. BACK | NEXT Easy Access To All Pages 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|