04-28-2017 08:43 AM
I realize it is friday afternoon, head not working so fast anymore.
I have a fairly big data cluster (100k data points altogether) that I use in the main loop, keep it in shift registers, adding/changeing data over time.
Now I like to read some of that data also in another loop, but did not find a good solution up front. It feels like it is a schoolbook example, and therefore I thought someone more clever than me might see a good solution directly!
Solved! Go to Solution.
04-28-2017
08:50 AM
- last edited on
05-13-2025
09:13 AM
by
Content Cleaner
If you are running 2016, you might consider using channel wires.
04-28-2017 08:50 AM
See here for a nugget I wrote on Action Engines.
If you are not familiar with them read that nugget and imagine moving your shift registers into a sub-VI that can be accessed from more than one loop.
It will cleanup your diagram a bit as well.
Ben
04-28-2017 08:51 AM
Functional global maybe?
04-28-2017 09:07 AM
Sorry, I am at labview 2015, and need to compile at LV2012 in the end...
04-28-2017 11:10 AM
With the assumption that you are only updating the value in one place and your other processes just need to read the latest value (do not care when it updates), I give you 2 options:
1. Data Value Reference (DVR)
2. Global Variable
If you are dealing with a large amount of data (I would put 100k data points in that category), I would go with a Data Value Reference (DVR).
05-02-2017 06:59 AM - edited 05-02-2017 06:59 AM
Crossrulz, how would I code a Data Value Reference if I like to keep my shift register? The quick tests I just did suggested I need to make a new reference for each round in the main loop, and somehow transfer that reference to the other loop.
Ola
This vi does not work at all...
05-02-2017 07:27 AM - edited 05-02-2017 07:27 AM
You need to create the DVR before both loops and pass the reference into the loops.
05-02-2017 07:42 AM
I understand the simple example, and is there a way to use a similar approach to read data that is stored in a large shift register?
05-02-2017 11:44 AM
@Ola_A wrote:
I understand the simple example, and is there a way to use a similar approach to read data that is stored in a large shift register?
Just make sure the data type of the DVR matches that of the shift register and it will work exactly the same way.