PRINT #n x$; y; z.... Statement |
Purpose | To send a string of ASCII characters formed by its parameter
list ( x$ y z ) out of the PLC to
other devices via the communication channel #n. Parameters: n must be an integer constant of between 1 and 8. Integer value in the parameter list (y; z..) will be converted into the equivalent ASCII representation. Each parameter must be separated by the semicolon(;). Action : The ASCII string is first formed by the PRINT statement using all the arguments in the argument list and the completed string is then sent out of the serial channel #n at one go. The PRINT statement automatically sends a Carriage Return (CR-ASCII 13) out of the specified serial port after sending out the last character in the argument list. the PRINT statement that ends with a semi-colon ";", will not send the CR character. If you have a long string to send than you can use ";" to break the whole command into several lines, with each line ending with a ";" except the last lines. |
Examples | PRINT #2 "The value of A+B = ";A+B; PRINT #2 "Units" |
Comments: | IF A=5 and B=100, the string "The value of A+B = 105 Units" and a CR character will be sent out via the comm. port #2. In i-TRiLOGI simulation mode, the ASCII string will be displayed on a pop-up window to simulate PRINT action. |
See Also | INPUT$( ), INCOMM, OUTCOMM |