Jump to content

Match pattern problem


Recommended Posts

Hello all,

I am having an interesting problem that i finally traced down to the simple little "match pattern" vi. I inherited many programs that use that vi for everything from pulling a single character out to sorting a huge list from a text file (neither of which i advocate).  HOWEVER, I was troubleshooting some code that only showed an error in one specific situation and upon delving in I found this vi to be misbehaving, or more likely I misunderstand how it is behaving ;-)

 

The vi has to remove an echo command then display the response. it goes like this  i send 0xABCD and read back 0xABCD1234, i need to display 0x1234. I did a workaround where i read the number of bytes sent then use that as an offset for "string subset" vi. but i am curious why "match pattern" is not working for this one hex command .

 

Please see the attached vi. that will show two hex commands, one that works and one that does not. You will notice both sent commands have 14 bytes and match the first 14 bytes of the reply, both show a match if you pull the first 14 bytes of the reply but only one matches with match pattern...it is written with LV 2011 SP1.

Thanks for looking.

Dave

MatchProblems.vi

Link to comment

Thanks Mellroth!

That was it....i did a "search and replace" for 0x5C with null on both strings and it is working now...although i see a new folly in the way we do this, there are many characters we will inadvertently hit since our string is any combination of hex characters 0x3F (?) 0x2E (.) etc.  

Thanks for the info 

Dave

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...

Important Information

By using this site, you agree to our Terms of Use.