LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Search 1D Array does not appear to work.

Solved!
Go to solution

I'm receiving strings from RS232 for Brightness Up / Down presses and releases from a display.

So I receive UPP and UPR which translates as UP pressed and UP released and the similar for Brightness Down, DNP and DNR.

However the Search 1D Array does not appear to recognize any of these and just returns -1 instead of the appropriate number for the following case.

 

0 Kudos
Message 1 of 6
(3,032 Views)
Solution
Accepted by topic author NewWorldMan

The received commands include the CR-LF termination, while the array elements don't. You should extract the first 3 chars from the received strings.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 2 of 6
(3,029 Views)

Yes I see where I was going wrong now. I only need to deal with a line feed and not a carriage return.

Thank you for that, I now have it sorted.

Sometimes I can't see what's staring me in the face.

I'm still learning LabView, but unfortunately do not get to use it enough.

 

 

Many apologies to 'altenbach' for your piece of code and not fully understanding.

0 Kudos
Message 3 of 6
(3,017 Views)

Then you should give Paolo credit for giving you the solution rather than marking your own reply as the solution.  First, go to the options menu to the upper right of your post to Unmark it as the solution.

0 Kudos
Message 4 of 6
(2,992 Views)

I'm sorry about that, as you can see I've now ammended that.

My intentions were good and I didn't want to offend anyone.

Many thanks Paolo for the solution and sorry if I offended you.

Thank you Ravens Fan for putting me straight. The last thing I wanted to do was upset anybody.

Hopefully one day I'll get the hang of all this.

 

Thanks again for the help.

 

Message 5 of 6
(2,976 Views)

No upsetting, NWM. Glad to be helpful, like (nearly) all other posters of this forum!

Ravens Fan only wanted to point you in right direction about using the forum.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 6 of 6
(2,945 Views)