Internet PLC Forum

General => Technical support => Topic started by: charlie on January 11, 2005, 04:26:41 PM

Title: Read from rs232 port
Post by: charlie on January 11, 2005, 04:26:41 PM
Can someone help me with a program that  can read the RS232 port.  The ASCIIi number 100 followed by CR  turns on output one of the T100MD. If ASCII 100 CR is not present at the RS232 the output turns off. The PLC needs to countinually scan the RS 232 port.
Thanks
Charlie
Title: Re:Read from rs232 port
Post by: support on January 12, 2005, 10:28:40 PM
Use a clock pulse to trigger a custom function periodically to check the serial buffer using the INPUT$(1) command.

  A$ = INPUT$(1)

A$ will contain the ASCII text string (single character in your case) whenever a CR is received. Otherwise, A$ returns an empty string. You can then check the first character in A$ using "ASC" function to determine if you wish to turn ON/OFF the output.