08-20-2018 08:46 AM
Okay, this is a first for me. The Read from Binary File VI is only working when run from my base VI, and never when I place it in a SubVI. It always returns error 1. I've tried creating different SubVIs, and the error is the same. The only VI that returns an error is the Read from Binary File VI. The others will work from the SubVI.
I've included pictures because the VI has a ton of other project VIs, and the project is huge. I was also afraid that boxing up the portion of code for a dummy VI would warp the results of the problem I'm having.
This is LabView 2016.
This is the SubVI that does not work.
This is my probe results for the SubVI
This code works perfectly fine even though it's just a copy-paste from the SubVI
Here's the probe results when not run from the SubVI
Doe anyone have any clue what I could try from here?
Thanks.
08-20-2018 09:18 AM
What do you get if you probe the reference out of the Read Binary File? I am just curious if the reference is still valid there since that is generally what causes error code 1.
08-20-2018 09:33 AM - edited 08-20-2018 09:38 AM
EDIT: Apologies I misread the question and assumed it was the WRITE that wasn't working!
08-20-2018 09:43 AM - edited 08-20-2018 09:45 AM
@crossrulz wrote:
What do you get if you probe the reference out of the Read Binary File? I am just curious if the reference is still valid there since that is generally what causes error code 1.
The reference is the same and still valid. I can delete the error, and nothing else causes any error with that same reference.
Basically, using the same reference, the next write does not create an error, and the read does again (only in the SubVI). It's very strange.
08-20-2018 10:08 AM
In your image for "in the top level version" the error cluster is not wired. Could it be that it does have an error but because the wire is not wired you are suppressing the error?
If so it may come down to the file not existing on an initial go?
No answers here, only questions,
Ben
08-20-2018 10:19 AM
@Ben wrote:
In your image for "in the top level version" the error cluster is not wired. Could it be that it does have an error but because the wire is not wired you are suppressing the error?
If so it may come down to the file not existing on an initial go?
No answers here, only questions,
Ben
Sorry, I made that a little confusing, but that case only runs when there is an error because if there is no error, the array will not be empty. In any case, if the Read VI were causing an error on the top level VI, the second Read would be causing an error again like it does while in the SubVI.
08-20-2018 10:24 AM - edited 08-20-2018 10:28 AM
Is it possible the file is being created in a parallel thread and not there yet?
And as a shot in the dark, can you toss the while loop since it does not do anything anyway?
Ben
08-20-2018 10:28 AM
@Ben wrote:
Is it possible the file is being created in a parallel thread and not there yet?
Then the error would be coming from the Open/Create/Replace File function. My similar follow on thought was a parallel process deletes the file before the read. Seems very unlikely, but that is all I can currently think of.
08-20-2018 10:38 AM
I am not good at troubleshooting images, but if you take the working version, lasso the relevant code, and "create subVI from selection", do you still get the same error?
08-20-2018 11:48 AM
@Ben wrote:
Is it possible the file is being created in a parallel thread and not there yet?
And as a shot in the dark, can you toss the while loop since it does not do anything anyway?
Ben
I'm not sure what you mean by the first part, but I tried the second part, and the problem still exists.