News:

  • August 15, 2026, 06:09:13 AM

Login with username, password and session length

Author Topic: STRFIND Anomaly  (Read 7915 times)

Bolt

  • Hero Member
  • *****
  • Posts: 598
STRFIND Anomaly
« on: April 06, 2023, 05:27:13 PM »
I have the attached logic running, it's been successful 58 times. However, 4 times it has failed, always on "MGOX". It fails on this on each occasion of "MGOX". I added the ", OTHER" to SL0, just to be sure it was not because it was at the end of the string, but it still fails to find it (N11 = -1). What am I missing here? It works on the others, and I use the != -1 logic frequently in my programs, so that shouldn't be the issue, what else can I check?
« Last Edit: April 18, 2023, 02:17:50 PM by Bolt »

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3843
    • Host Engineering
Re: STRFIND Anomaly
« Reply #1 on: April 06, 2023, 05:34:11 PM »
Look at your Ingredient block in a Memory View and select Quoted String as the format.  Make sure your MGOX entry has no spaces or other whitespace characters that might not show up on the ASCII format status in Ladder View.

Bolt

  • Hero Member
  • *****
  • Posts: 598
Re: STRFIND Anomaly
« Reply #2 on: April 06, 2023, 05:51:50 PM »
Perfect, changed an STRTRIM check box leading up to here, I bet it will work tomorrow. Thanks!

Bolt

  • Hero Member
  • *****
  • Posts: 598
Re: STRFIND Anomaly
« Reply #3 on: April 18, 2023, 02:25:47 PM »
So this is still persisting, even with some slight tweaks and changes (I updated the screenshot in the original post to prevent confusion). I have added STRTRIM and STRCASE to the string's processing prior to this stage being triggered. I cleaned it up yesterday, and since then it's worked correctly 9 times, and failed to run correctly 2 times. Any more ideas? I've bumped the IngPtr back to an offending name just to show full detail. There are no spaces or other characters in the string, strictly the letters as they appear in the SL0. SL0 is not being written anywhere, just the initial write via a DataView.

Also, I should add there's a minimum of 30 seconds between new data showing up in the IngPtr queue, so it's not being bombarded by data at all.
« Last Edit: April 18, 2023, 02:31:17 PM by Bolt »

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3843
    • Host Engineering
Re: STRFIND Anomaly
« Reply #4 on: April 18, 2023, 02:41:38 PM »
I would think there would be a MOVE 0 N11 right before the STRFIND?  That is critical (it is both an Input and an Output parameter)

Bolt

  • Hero Member
  • *****
  • Posts: 598
Re: STRFIND Anomaly
« Reply #5 on: April 18, 2023, 07:04:56 PM »
Yes, I believe that's it. I was overlooking that key detail. It was stepping through the list sequentially, beginning where it left off last time. Thank you!