03-24-2021 10:33 AM
Hi All
I am trying to load a vi that calls a LabVIEW class file but as soon as the LabVIEW object calls in the LabVIEW class file I get an error code 1556
"LabVIEW: (Hex 0x614) The reference is invalid. This error might occur because the reference has been deleted"
The class file has not been deleted and this occurs when it reaches a Data value reference Read/Write Node"
If anyone can offer some guidance on this I will be very greatful
Best Wishes and many thanks
Andrew
03-25-2021 06:32 AM
Hi Andrew,
This article discusses how this error can arise when running an executable created using the GPU Analysis toolkit and so most of it is probably not relevant, however it does explain different causes of the error which may also be applicable to the LabVIEW class file you're trying to call. Is it possible that the lvclass file is being deleted implicitly?
03-29-2021 06:39 AM
Hi
I am not sure if it is being deleted implicitly or nor, it seems to exist but LabVIEW will not read it.
04-06-2021 03:50 AM
Hi
I apologise for the delay in replying but where are LabVIEW class files meant to be stored, it is currently in my user.lib folder. I have read the article, I struggled to understand it.
Best Wishes
Andrew
04-06-2021 07:18 AM
Can you post the VI in which the error occurs, along with perhaps any other VIs between the creation of the class object and the error? (Maybe there are no other VIs, maybe there are a long chain... if you can guess which are relevant, try posting those first, if not, more is better than too little).
My guess is somewhere you're losing the object (not a file on disk, but an object travelling on a LabVIEW wire) and then maybe it contains a reference, that is being read in the VI creating the error, but the class object has reinitialized to a default object and has an invalid reference.
04-06-2021 07:21 AM
This is one of them
04-06-2021 07:26 AM
Is there an Initialize function or similar for the "HIK Vision" class that you're not calling?
This shows basically what you're doing, and what you're missing:
In the first case, the constant is used as a DVR input. This is equivalent to a class object that never set the DVR using New Data Value Reference.
In the second case, I call New Data Value Reference, and there is no error.
04-06-2021 07:29 AM
here is an initialize vi. I hope this helps
04-06-2021 07:36 AM
If that's the first VI you call with this class, then I'd guess you're never creating the Data Value References (DVRs).
They have to be created using New Data Value Reference (with the appropriate data type, but the value doesn't have to be what you want - you can populate that using the Open.vi you shared for example).
You can then use a normal "Bundle" or "Bundle by Name" node to put the DVRs inside the class, for later use with the In-Place Element Structures.
04-06-2021 07:52 AM
Thank you, so how could do this, I am not quite sure?