08-20-2018 11:50 AM
@altenbach wrote:
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?
I have tried this, and it is the same thing. It's also only the Read VI. I can put everything but that one in SubVIs, and everything runs fine. I can make a SubVI for just that Read VI, and it still fails.
08-21-2018 10:54 AM
@cwoolly wrote:
@altenbach wrote:
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?
I have tried this, and it is the same thing. It's also only the Read VI. I can put everything but that one in SubVIs, and everything runs fine. I can make a SubVI for just that Read VI, and it still fails.
Well, can you attach a very simple VI that reliably demonstrates the problem? I currently don't have '2016 installed, but I could test in other versions. Did you contact NI?
08-21-2018 10:59 AM
@altenbach wrote:
@cwoolly wrote:
@altenbach wrote:
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?
I have tried this, and it is the same thing. It's also only the Read VI. I can put everything but that one in SubVIs, and everything runs fine. I can make a SubVI for just that Read VI, and it still fails.
Well, can you attach a very simple VI that reliably demonstrates the problem? I currently don't have '2016 installed, but I could test in other versions. Did you contact NI?
Yup!
If a mass compile does not fix it, send the code to NI so that they can verify they see the same error. If they don't it could indicate a LV repair. If they can verify it should be logged so it can be fixed.
Ben
08-22-2018 06:12 AM
With only images posted and no actual code that demonstrates the behaviour in a reproducible way, we can keep sitting here and guessing until the universe freezes over. Post the code (downsaved to 2016 or earlier) and we can look at it. So far in all of my 25 years of LabVIEW experience all I can say is that this is either a hidden wiring error that looks like it is wired correctly up but isn't, or it is not from this part of the universe I live in.
08-22-2018 07:25 AM - edited 08-22-2018 07:41 AM
@crossrulz wrote:
@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.
No, you can create a file, so the error comes from the Read Binary, and then that error is either passed through to the Write (in the subVI version, preventing anything being written) or is not passed (in the non-subVI version allowing the Write to work). There is nothing strange going on here, and it has nothing to do with subVIs; all the probe screenshots look exactly as one would expect, given the two different versions of code shown (and assuming the code has been run more than once, so the non-subVI version has generated a file).
CORRECTION: your right, by default it is just "Open", which would throw error 7. So the file exists.
08-22-2018 07:32 AM
But error 1 is an invalid parameter. If the file had been removed between opening it and trying to access it you would get a different error code. The error 1 is usually an indication of a refnum which has gone bad, either because it was auto-"garbage collected" by the LabVIEW runtime system since the top level VI in whose hierarchy the refnum was opened has gone idle, or because of wiring errors such as overlapping/hidden tunnels, or default value tunnels in previous iterations of a loop. Occasionally there are LabVIEW nodes that can create error 1 if different parameters for the node are contradicting each other in some ways, but those are seldom and far in between.
08-22-2018 08:36 AM
It looks to me like the 2nd read will Always fail. You write the Array to the file which'll put the file pointer at the end of the file, then try to read an Array back, which'll Always result in empty data. You'll have to set the File pointer to the start to do that, although since you know what you just wrote you don't really need to read the file at all, just send the Array wire forward.
/Y
08-22-2018 10:34 AM
@Yamaeda wrote:
It looks to me like the 2nd read will Always fail.
Yes it will. Error Code 4 will be generated in that case.
08-22-2018 10:37 AM
@crossrulz wrote:
@Yamaeda wrote:
It looks to me like the 2nd read will Always fail.
Yes it will. Error Code 4 will be generated in that case.
This would explain a problem I've had in the past. So, would the solution be to just close it, then open it back up to read again? I get that I could just not read it back and pass along the data, I'm just curious.
08-22-2018 10:49 AM
@cwoolly wrote:
This would explain a problem I've had in the past. So, would the solution be to just close it, then open it back up to read again? I get that I could just not read it back and pass along the data, I'm just curious.
I would just not do the read and use the data you already have that you just wrote. The secondary route would be to use the Set File Position to 0 after Start (ie the beginning of the file) and then read.