LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

little problem in my code...can you detect it?

i have made this little code to detect in a string (min 3 char) if there are special characters....in case they are present my output needs to be F, if there aren't T.

 

but it doesn't work....

 

why?

Using LabVIEW 7.1
0 Kudos
Message 1 of 10
(2,647 Views)

Hi gigi,

 

when you ask for help on debugging your code you should attach the actual code, nut just a picture of it!

 

Meanwhile I had to re-code your picture, but it seems to work for me:

check.png

(The size check is up to you...)

 


but it doesn't work....


 

Has no one told you by now that "doesn't work" isn't a good error description?

What error(s)? What's wrong? Where's your problem at debugging it?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(2,631 Views)

There should be "OR" operator insted of "AND" operator. I guess.. 😉

0 Kudos
Message 3 of 10
(2,623 Views)

Your code seems correct to me... Please upload a small vi so we can test it without actually coding.

GerdW: gigi is working with LV 7.1 so the conditional terminal in the loop is not available.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 10
(2,598 Views)

Check this code.

0 Kudos
Message 5 of 10
(2,595 Views)

Hi Paolo,

 

now you mention it I also remember I gave gigi the advice to use a signature noting that old LabVIEW version...

 

@gigi:

Use an "AND Array Elements" instead the conditional break of the FOR loop...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(2,590 Views)

here my code...

 

signature with labview version done 🙂

 

after lunch i'll try and array elements (if i'll find it)

Using LabVIEW 7.1
0 Kudos
Message 7 of 10
(2,566 Views)

I overlooked that you need a True getting out the while loop if the string is OK.

Replace <0 with >=0 and change the conditional terminal to "Stop if True".

You may also improve the code replacing the constant 12 with the character array size; this prevents to break the code if you later want to add or remove forbidden characters.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 8 of 10
(2,555 Views)

Hi gigi,

 

all you need is some boolean logic:

check.png

(String constants set to "\-Code" display mode.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 10
(2,548 Views)

DONE 🙂

 

THANK YOU ALL 🙂

 

 

Using LabVIEW 7.1
0 Kudos
Message 10 of 10
(2,538 Views)