LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

case structure

I'm using case structure and i made three cases read, write , and none to do all these functions from stm32 via uart.
but when i give input read or write it still runs the default case only.
what could be the issue i used trim whitespace and string indicator to check the input. but still it only runs the default case.

0 Kudos
Message 1 of 5
(362 Views)

Hi Anup,

 


@AnupSW13 wrote:

when i give input read or write it still runs the default case only.
what could be the issue i used trim whitespace and string indicator to check the input. but still it only runs the default case.


I guess there is a problem in your code.

As you forgot to attach code you need to debug on your own…

Best regards,
GerdW


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

Also know that matches are case sensitive unless you configure it for "case insensitive match".

 

Why not place an indicator on the wire going to the selector and make sure it contains what you think it does. (e.g. switch it to \-codes display)

0 Kudos
Message 3 of 5
(339 Views)

@AnupSW13 wrote:

I'm using case structure and i made three cases read, write , and none to do all these functions from stm32 via uart.
but when i give input read or write it still runs the default case only.
what could be the issue i used trim whitespace and string indicator to check the input. but still it only runs the default case.


What debugging steps have you used?   If only the default case executes (and we can't verify that this is really happening until we can look at your code) then the case selector input has not matched any other case.  Anything is possible; typographical errors, a hidden tunnel under the selector, race conditions,  etc...


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 5
(303 Views)

@AnupSW13 wrote:

I'm using case structure and i made three cases read, write , and none to do all these functions from stm32 via uart.
but when i give input read or write it still runs the default case only.
what could be the issue i used trim whitespace and string indicator to check the input. but still it only runs the default case.


If functions is a type def'd enum (it sounds like it should), you wouldn't have this issue.

 

The case structure would only allow the read, write and none, and the default case can and should be removed.

Message 5 of 5
(293 Views)