06-02-2015 02:10 PM - edited 06-02-2015 02:17 PM
hello every one !
i have little issue with the case structure
situation :
I have created the case structure and case selection is done by the string,
according to the case selection respected led should glow
the case structure is as follow :
case 1 [when string is "abc"]
{
led 1 = true
led 2 = false
}
case 2 [when string is ''pqr'']
{
led 1 = false
led 2 = true
}
case3 [when string is '''',default]
{
led 1 = false
led 2 = false
}
now what is happening :
i clicked on the "run continuously"
now when i type the any of the string nothing is happening !!
my observation :
when i type abc/pqr in the string input, it actually blinks the led for very small fraction of time which i can not see and finally set into the default case.
what I am expecting from this code !
when i put "abc" in the string input , 'led 1' should be turn on and remain on untill i put pqr into the string input
same when i put pqr into the string input, led 2 should be turn on and remain on untill i put abc into the string input !
Thanks in advance !
Solved! Go to Solution.
06-02-2015 02:14 PM
First of all -Do not use run continously! ?instead put this case structure in while loop and that should do the trick
06-02-2015 02:22 PM
hello
I have tried it already
actually i am using it as a sub program
and main program is already in the while loop
the string is coming from an instrument --> string is updated by certain interval, till new string is available i have to show the older string ![to show which string is available i am using leds] !
but thanks a lot for the super instant reply !
06-02-2015 02:25 PM
But the VI you've attached is case-sensitive on strings:
string 1
string 2
others
And I'm getting desired results...
06-02-2015 02:29 PM
Your picture and your conversation about abc and pqr do not match the VI you've attached.
My guess is that you have the string in your abc/pqr picture set to update continuously while typing and you are getting a match for that fraction of a second after you've typed abc and before hitting the \
06-02-2015 02:30 PM
How do you use it in your main program? Maby this is the issue...
06-02-2015 02:31 PM - edited 06-02-2015 02:31 PM
are u sure Because in my computer LEDs are not glowing: Smiley Frustrated:
06-02-2015 02:37 PM
@jay_sidd wrote:
are u sure Because in my computer LEDs are not glowing: Smiley Frustrated:
Who are you responding to?
Which VI are you trying to work with here? The one you actually attached, or the one you talk about and show a screenshot of?
06-02-2015 02:43 PM - edited 06-02-2015 02:48 PM
let me elaborate
i have 10 VISA read / write block connected one by one
first i am requesting the data lets say :MODE? [operation mode]
in response instrument will give me either :MODE CC or :MODE CP data type is string
after giving this response labview will go to next VISA R/W block and so on
once labview reaches at the end it will start the same routing again !
so once i get the mode status, i will get it again after some time till that time, I have to show the previous mode status
{I am distinguishing the string by simple led }
now what is happen
visa reading and writing is happening
and once string is generated it doesnot set the led and case structure remained in the default case which is nothing but a off leds
new to this forum
so dont exactly know how to tag the person to whom u r replying
06-02-2015 02:47 PM - edited 06-02-2015 02:48 PM
Now you are talking about a third, more complicated version of your VI.
We can't even attempt to help you debug that since you haven't attached that one at all.
Be sure to put in there some controls where you data from the serial port is saved as default, or the strings are put in there as constants so we can see what the actual data looks like. Perhaps you have control codes or termination characters you aren't accounting for.