Jump to content

Subroutine for reading input


Recommended Posts

I've been fighting this one for a long time. I need to write a new subroutine for an existing program. I have the RS-232 port initialized properly, but I need to see the numeric character string come in first. If the string does not meet correct criteria (such as value(s) in range for the function), then sends out a '0', followed by a <CR> (ASCII 13). If it does, then the function needs to be performed (by other subroutines that are already defined) then sends out '1' <CR>.

Thank you for your support.

Link to comment
Share on other sites

You'll be using the Protocol:Scan FB to read the incoming data stream, capturing the characters you are interested in to MI registers so that your ladder program can check their ranges and decide which message to send out. Hard to be more helpful without knowing more about the incoming data...

Thanks, I understand that much, but I was hoping not to reinvent the wheel and find a subroutine that worked. The examples don't have anything like it, and I've struggled to make a routine work for over a month with no sucess.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.