03-05-2013 01:45 AM
Hi everyone,
i am using to case stuctur for switching between case 1 und case 2, want to record that how many times switchs it for case 1 →case 2 → case1,for example,1th case 1 →case 2 → case1,2th case 1 →case 2 → case1...
n-th case 1 →case 2 → case1,how to complete this function?if f anyone can give me some ideas that would be appreciated.
thanks in Advanced
Note:Labview 2009 sp1
Solved! Go to Solution.
03-05-2013 01:56 AM
Hi jetfire,
maybe some pseudo-code will help:
IF case_now=case2 AND case_before=case1 THEN Increment Counter
As usual:
Show what you have programmed so far and we will help with adjustments/hints.
As long as you only describe your homework you will only get textual descriptions of the solution...
03-05-2013 02:24 AM
thank your for your reply,here i posted my code,i want to using array controller for case switching with different period(period:case1→case2→case1,the index of array controller indicates N th of Period,can your give me some advise?
thanks
@GerdW wrote:
Hi jetfire,
maybe some pseudo-code will help:
IF case_now=case2 AND case_before=case1 THEN Increment Counter
As usual:
Show what you have programmed so far and we will help with adjustments/hints.
As long as you only describe your homework you will only get textual descriptions of the solution...
03-05-2013 02:30 AM
03-05-2013 02:55 AM - edited 03-05-2013 02:57 AM
@GerdW wrote:
Hi jetfire,
as I wrote before:
thank you,i have a question about your code,why ist left shift register 3 ,right only 2 for case switching?
03-05-2013 02:58 AM
Hi jetfire,
you should read the context heklp on shift registers. There are 3 shift registers used in the code...
You can drag down the left side of the shift register to access older values (not just of the iteration before, but also i-2...)! As given in the pseudo code you need to access the current vaule as well as the vlaue of the iteration before thus I oulled down the shift register terminal to show one more output...
03-05-2013 03:00 AM - edited 03-05-2013 03:03 AM
@GerdW wrote:
Hi jetfire,
you should read the context heklp on shift registers. There are 3 shift registers used in the code...
You can drag down the left side of the shift register to access older values (not just of the iteration before, but also i-2...)! As given in the pseudo code you need to access the current vaule as well as the vlaue of the iteration before thus I oulled down the shift register terminal to show one more output...
ok,thank you! i will immediately read about shift registers