News:

  • October 14, 2025, 01:20:22 AM

Login with username, password and session length

Author Topic: StreamIn Termination  (Read 2970 times)

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
StreamIn Termination
« on: December 10, 2019, 11:00:07 AM »
I am using the StreamIn instruction in a stage to read serial ASCII data from a test device.  Problem is that I don't always get the End of Transmission character, but I do know when the device has finished  the test. In the stage I break the power flow to the instruction  before jumping out of the stage, but I still get this error "Device instruction terminated before completion @00000332 (STREAMIN at CirrusSerialScan@51)"  Is there a way to prevent that ?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: StreamIn Termination
« Reply #1 on: December 10, 2019, 11:22:33 AM »
I am using the StreamIn instruction in a stage to read serial ASCII data from a test device.  Problem is that I don't always get the End of Transmission character, but I do know when the device has finished  the test. In the stage I break the power flow to the instruction  before jumping out of the stage, but I still get this error "Device instruction terminated before completion @00000332 (STREAMIN at CirrusSerialScan@51)"  Is there a way to prevent that ?

I personally don't enable a STREAMIN until I know the data is there waiting, so I rarely use the timeout terminator. If I expect a terminator, I would enable with the terminator and the max number of bytes in .InQueue.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: StreamIn Termination
« Reply #2 on: December 10, 2019, 02:27:22 PM »
In the stage before the StreamIn, I check IntSerial.InQueue . Infact, I copy that value to another location.  StreamIn looks for either a 0x0A or 0xFE as a delimiter.  When I see IntSerial.InQueue go non zero I jump to that stage with the StreamIn instruction. No Timeout or byte limit.  The strings come in delimited by 0x0A then at the end I get 1 character in, and its only the 0xfe and it just sits in that stage. Could it be that its looking for data and a delimiter?  On the tester if I make it pass, it sends a  "Passed" followed by an 0xfe and no problem. Seems only if a single character delimiter is sent, it waits.

To get around it, I put a timer on a single character InCount If the number of characters in the queue are greater than 1, it jumps to a stage with a StreamIn looking for the delimiters.  If the count in the queue stays at 1 for 100ms, then I jump to a different StreamIn stage looking only for 1 character. Then it doesn't hang. I think it shouldn't hang on 1 character, if the character is one of the delimiters.
« Last Edit: December 10, 2019, 03:04:47 PM by ATU »

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: StreamIn Termination
« Reply #3 on: December 10, 2019, 06:11:04 PM »
May be a bug. Lemme dig in a bit.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: StreamIn Termination
« Reply #4 on: December 11, 2019, 10:29:43 AM »
I Switched the 1st and 2nd Delimiters. It did the same thing.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: StreamIn Termination
« Reply #5 on: December 12, 2019, 10:31:17 AM »
Looks like a day 1 bug. Very specific to "any one of" terminators.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: StreamIn Termination
« Reply #6 on: December 12, 2019, 11:11:17 AM »
I am very appreciative that Host takes the the time to fix even the small bugs. Not always the case with other software packages. Makes my job easier when things work the way they should.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: StreamIn Termination
« Reply #7 on: December 12, 2019, 11:32:58 AM »
I am very appreciative that Host takes the the time to fix even the small bugs. Not always the case with other software packages. Makes my job easier when things work the way they should.

I am sorry it wasn't right to start with.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Bolt

  • Hero Member
  • *****
  • Posts: 591
Re: StreamIn Termination
« Reply #8 on: December 12, 2019, 11:41:41 AM »
I am very appreciative that Host takes the the time to fix even the small bugs. Not always the case with other software packages. Makes my job easier when things work the way they should.

Nowhere do I read that they fixed it!  :P
Just kidding, I also admire their description of found bugs, and the repair of such bugs when possible.  If only more software companies did so.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: StreamIn Termination
« Reply #9 on: December 12, 2019, 11:55:59 AM »
Nowhere do I read that they fixed it!  :P
Just kidding, I also admire their description of found bugs, and the repair of such bugs when possible.  If only more software companies did so.

I prefer to be transparent (it can help users with workarounds), but I'm certain that if we were larger there would be those who would twist it into trouble. It would be easy enough to say "we'll look at it" and then the fix show up in the errata of the next release, but as long as it doesn't become trouble to us, we'll continue to interact with users on our forum. ADC reasonably has different guidelines for their forum and we try to respect those. Sometimes I forget where I am though...sorry guys.  :o

Just an FYI, if you hear us use the phrase "day 1 bug", that generally means that it appears to have always been broken. We always find those interesting for a variety of reasons.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO