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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...