From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-29-2011 04:18 AM
Hello,
I want to know how to ignore the default case of case structure. Please see attachment.
I expect to get the output array be [6, 7,10, 16, 24, 36]. Instead, I get [0, 6, 7, 0, 0, 10, 0, 0, 0,....]. When the case structure encounters default case, it also outputs 0 to the array.
Please help me. Thank you.
04-29-2011 04:26 AM
Hi,
Default case run when there is no case match at case selector. So those times when zero comes was the time when no case match at case selector.
One quick solution can be to search zero in your output and delete them from array using index from search. Else change your logic at case selector.
- HS
04-29-2011 04:38 AM
Hi
What you need to do is pretty simple. Keep the 0 case as default and everytime you hit this case you just need to let the shift register pass through the for loop without adding any new elements this way you will end up with the array you expected.
Sletten
04-29-2011 05:04 AM
Hi,
Check this out.. I guess this is the solution.
Regards,
Nitzz
(Kudos are always Welcome)
05-02-2011 02:47 AM
Thank you for all responses. Another question.
Regarding to FOR LOOP. Can we assign the initial value of i ? Like in C language for (i=5; i++; i<10).
Thank you.
05-02-2011 03:47 AM