LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

saving values in shift registers and switching between them

What I need to do is to be able to press boolean A 5 times, then press boolean B 3 times for example and then press boolean A again and it then start on the 6th iteration in the same while loop, (see the attached example). Currently when I press A a few times then switch to B, the iteration value of the shift register used for A goes to 0. I do not want this. The reason that I am doing this is that I want to read for example 2 lines from a spreadsheet file. As I read the first line, (by using boolean A), I go from one value to the next. Then I take a couple values from the second line, (using boolean B). Then I go back and read from line 1 but I don't want to have to read all the elements from the
beginning, but since the shift register keeps going to 0 I keep having to do this. I can't wire the index to the iteration of the while loop, (as far as I can see), because I the iteration value is devided between the two choices. Any ideas or examples would be much helpful.

Thanks very much,

~Caltech.
0 Kudos
Message 1 of 7
(2,968 Views)
Hi CalTech
The reason for that is you are using default values when in other event and that loads 0 in the shift register. Wire all events and will run as expected.
See attached your modified vi.

Hope it helps

Alipio
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
Message 2 of 7
(2,967 Views)
Alipio,
Could you save this VI in version 6.1? I don't quite know what your talking about from just reading your responce and I can't read the VI because I don't have 7.1, only 6.1.

Thanks,

CalTech
0 Kudos
Message 3 of 7
(2,967 Views)
Sorry. I can´t

See attached word doc and will see what I meant.

Hope it helps.
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
0 Kudos
Message 4 of 7
(2,967 Views)
I love you man, thanks! "Its the little things that kill, tearin at my brains again" And is it not legal or something to format from a newer LabVIEW version to an older? Anyways, thanks for taking the time to help me on this, it was taking my time and I just coulden't see the answer.

CalTech, (Brian)
0 Kudos
Message 5 of 7
(2,967 Views)
Brian,
Here's a fixed LabVIEW 6.1 version with a few other improvements. Notice that you don't need all the fancy math with the booleans, a simple increment in each event is sufficient and the code is easier to understand. (I also added an indicator for each register so you see what's going on during testing. You can delete them again in the final code). Also notice that you need to create an event for the stop button. In your code the VI will not stop immediately, but only after instances of the other events have also occurred.
0 Kudos
Message 6 of 7
(2,967 Views)
Hi Brian.

Actually, I am using Labview 7.1 and can only save for version 7.0, no for 6.1.

Labview 7.0 was unistalled dyas ago. So hope in theese cases, a doc helps to solve problems, and somebody in this forum will like to help with other versions.

Cheers

Alipio
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
0 Kudos
Message 7 of 7
(2,967 Views)