LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to record number of times for Case switching

Solved!
Go to solution

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

0 Kudos
Message 1 of 7
(2,635 Views)

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...

Best regards,
GerdW


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

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...


 

0 Kudos
Message 3 of 7
(2,624 Views)
Solution
Accepted by topic author jetfire

Hi jetfire,

 

as I wrote before:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 7
(2,621 Views)

@GerdW wrote:

Hi jetfire,

 

as I wrote before:

check.png


thank you,i have a question about your code,why ist left shift register 3 ,right only 2 for case switching?

0 Kudos
Message 5 of 7
(2,616 Views)

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...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 7
(2,610 Views)

@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

0 Kudos
Message 7 of 7
(2,608 Views)