LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Action Engine - Shift Register 3rd element

Hi,

 

I am a fan of using function globals. In my program I'm using for every product examination after the test is finished the set action for writing the data to a uninitialized shift register and I want to read those data 3 times in every measurement. But after everytime I read the data back via the get method, my shift register is overwritten. I have attached a screenshot of this FGV. Do I have a chance to avoid to overwrite the data only in the set case and not in the get?

 

Kind Regards,

 

-- 

Joachim

0 Kudos
Message 1 of 6
(3,219 Views)
You need to wire the data through the get case as well, so that the data is propagated through the shift register. Use the same wire as you read from to use a copy of the data.
_____________________________
- Cheers, Ed
Message 2 of 6
(3,217 Views)
Your problem is the default value of the tunnel will overwrite the shift register value
_____________________________
- Cheers, Ed
0 Kudos
Message 3 of 6
(3,216 Views)

Hi Ed,

 

thanks for the reply. this doesn't solve the problem. when I write back the 3rd element from the shift register like in the attachment only the first get gives me the correct result. the second time I read the data via get the data are shifted and i get the wrong data.

 

Regards,

 

-- 

Joachim

0 Kudos
Message 4 of 6
(3,192 Views)

Joachim,

 

the shiftregister in your code has a history. So you dont only keep the data from n-1 but from n-2 and n-3 as well.

When you call "get" you retreive n-3 if the current call is the n-th one.... 

Question 1: Is that really what you want?

 

If YES, i recommend you not to use the shiftregister for keeping the history. Easy note: You can only write one value to it, but in order keep your historyu unchanged, you'd have to write three values.

So i recommend you to use a shiftregister to keep an array. That array includes your history.

 

hope this helps,

Norbert 

 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 6
(3,170 Views)

Norbert B wrote:

Joachim,

 

the shiftregister in your code has a history. So you dont only keep the data from n-1 but from n-2 and n-3 as well.

When you call "get" you retreive n-3 if the current call is the n-th one.... 


 


Additionally, every time you call the VI the history gets moved one place backwards, be it the set, get, or any other command.

Message Edited by yenknip on 10-15-2008 01:08 PM
_____________________________
- Cheers, Ed
0 Kudos
Message 6 of 6
(3,166 Views)