pat_newbie Posted August 5, 2019 Report Share Posted August 5, 2019 how to read the last text using visilogic proscan seem my existing readout are not able to capture the next line which is the "Ack". As you can see in hyper terminal, the "Ack" capture on the next link however It seem the proscan auto line break after receiving up to 32". Can anyone help? Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted August 5, 2019 MVP 2023 Report Share Posted August 5, 2019 Not exactly sure what you're asking here - what's "proscan"? Joe T. Link to comment Share on other sites More sharing options...
pat_newbie Posted August 6, 2019 Author Report Share Posted August 6, 2019 sorry is protocol scan in full. I'm using this protocol to rewrite a program for 4G modem so far everything is working however the last text is what i need to capture to compare whether this is a valid text send by user to perform acknowledgement. Please help thanks. Link to comment Share on other sites More sharing options...
pat_newbie Posted August 6, 2019 Author Report Share Posted August 6, 2019 I even tried with 2 lines index with 100 vector length each hoping to capture the text on the last line text but it was no good either. Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted August 6, 2019 MVP 2023 Report Share Posted August 6, 2019 You have an ETX of 0D+0A, so I'm assuming the modem is putting a CR + LF on the end of the string or this wouldn't work. Your terminal screen shot seems to agree with this. The SCAN block looks for the first matching Index on an incoming data stream. As your Index 0 variable is a Stream type, it will be the one chosen. Having a second Stream variable does not solve the problem. The "Ack" on the terminal screen is a new string on a new line. Are you resetting the SCAN block (reset MB 2403) as soon as you receive any string? If MB 2403 is on, the block is locked and you won't receive anything new. I generally have code that copies the string out of the variable vector as soon as the Session Complete bit comes on, and then I reset the Session Complete bit to cock it for the next string. You could make an entry at Index 0 that is simply "Ack". Put your Stream variable at Index 1. That way, you could check the value of MI 2723 when MB 2403 goes high to see if you got the "Ack" message (MI 2723 = 0) or something else that is not "Ack" (MI 2723 = 1). If the incoming stream does not match anything in your table then MI 2723 will equal -1. You might want to post your code. Joe T. Link to comment Share on other sites More sharing options...
pat_newbie Posted August 6, 2019 Author Report Share Posted August 6, 2019 Hi again, So what should be the correct ETX for my case as this cannot be left blank. For my trying i have removed the OD from the ETX and change the receive command and reset buffer to be in manual trigger mode but i'm still not able to capture the last text. Appreciate if you can resolve my problem. Link to comment Share on other sites More sharing options...
MVP 2023 Ausman Posted August 6, 2019 MVP 2023 Report Share Posted August 6, 2019 I might be dumb this morning, but what is your reason for using SB0? This seems like a block in the process to me. cheers, Aus Link to comment Share on other sites More sharing options...
pat_newbie Posted August 7, 2019 Author Report Share Posted August 7, 2019 The above program is done for step by step sending command to retrieve the text. i'm blocking it temporary so as to try the effect of clearing the buffer manually upon receiving the text so that i won't miss any of the text before clearing. mb347 is to perform manual reset. Link to comment Share on other sites More sharing options...
pat_newbie Posted August 7, 2019 Author Report Share Posted August 7, 2019 Current program i'm adding the MB1149 to switch over to manual triggering. it was suppose to clear buffer once mb2403 turn on for the original program however joe mentioned that i might be clearing the buffer too fast upon receiving the text so i add this for the testing. So anyone can resolve my issue on the last text? ☹️ Link to comment Share on other sites More sharing options...
pat_newbie Posted August 7, 2019 Author Report Share Posted August 7, 2019 Hi all, I have resolved the issue and confirm there is nothing wrong with 0D+0A for ETX or clear buffer issue. Testing the read back using hyper terminal have no issue capturing the full text from the modem however with the controller some text was missing. I guess is an bug issue from the controller. Please see screen shot an "ackkk" i send back to the modem using my mobile and in return the controller reply back with text that come with my mobile number. Case resolved. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now