LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pass error references to parallel loops

I have a program with two parallel loops, each of which are contained within subvis for compactness. One of the loops acquires data and writes it to a queue and the other reads the queue and performs calculations. The problem is that I would like to stop both loops if an error occurs in either loop but I get Error 1055 (Object reference is invalid) when trying to write the error to the reference. I know of several ways to get around this (i.e., depend on the timeout, write only the error status, etc.) but was wondering if anyone else has had a similar problem.

Thanks,

John
0 Kudos
Message 1 of 5
(2,871 Views)
What object are your trying to access using a reference and how do you give both VIs that reference? Could you post a picture of the code, or the code itself? When the error says the reference is invalid it probably is...for some reason.

As an alternative - why not just use a functional global? If there is an error somewhere set a flag in the global and let all VIs read that flag.

You could also make the VIs force destroy the que if there is an error, and then have both VIs stop if they see that the que has been destroyed (you can always recreate the que).
Message 2 of 5
(2,871 Views)
I have attached jpegs of the code for the main vi and for the data acquisition vi which is giving the problem. I tried to recreate this problem in a scaled down program, but it worked properly. I'll continue taking a closer look at this while I also consider other options.

Thanks
Download All
0 Kudos
Message 3 of 5
(2,871 Views)
My first though was that I don't like the coercion dots on the bundle function where you bundle the error references...but you have the same on all the other references you bundle (I haven't checked to see if that could cause the reference to be invalid).

I also noticed that you have two error clusters; Error 1 and error 2, but one of the references you bundle is called Parameter Setup Date instead of Error 2 which is what I would expect...is that the correct reference, or?
0 Kudos
Message 4 of 5
(2,871 Views)
The Parameter Setup Date is actually the indicator below the Error 2 reference. I didn't notice that this label stretched out in making the jpeg.

I'm not sure what the problem was, but I made a new reference cluster which appears to work.

Thanks for the help.

John
0 Kudos
Message 5 of 5
(2,871 Views)