02-04-2021 07:18 AM
I thought I could easily create a data value reference in an action engine. I've attached what I built. However, while 'init' doesn't cause an error, 'read' and 'write' and 'close' results in error 1556 "the reference is invalid. This error might occur because the reference has been deleted."
Does shift registers not handle references?
Solved! Go to Solution.
02-04-2021 08:30 AM - edited 02-04-2021 08:34 AM
How are you calling this subVI?
You don't have any of the terminals wired to the connector panel.
Are you running this from its own front panel? If so, when the VI goes dead, you'll lose the DVR you just created from the Init case.
My understanding is that it is also a best practice to put the terminals of that subVI onto the top level of the block diagram.
I don't understand your reasoning for putting a DVR in an action engine. The action engine wraps up the storage of data for you. The DVR is a method of storing data in a single location for you. It's like you are putting a box of data inside of another box. The DVR serves no purpose in this case since you have no means of using the reference wire anywhere else in your application.
02-04-2021 10:46 AM
I was testing out the idea of using a DVR to manipulate large data reads from an analog channel, instead of storing the data in FGV.
I was working with the mindset of building and testing subVIs and overlooked memory references being destroyed upon the run end of a VI. Thank you for pointing that out.
And so, when I placed the DVR VI in another while loop, it operated as expected.