LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

apparently random Error 1 with Windows 10 and Write to file express vi

Solved!
Go to solution

Hi

 

I know that I should get rid of the Express.vi but I have too many and no time to clear them all. However, I have a program that measures some properties (with PXI and GPIB interfaces). It worked fine for several years in Windows 8. However, following a computer crash I moved to win 10. Now, from time to time (after 2 hours or 12 hours of saving data), I get an Error 1. The saved file has always different size (20 kb or 250 kb...) it is not too big.

It is not related with wrong characters in the filename either because I save data in the same file.

Has anyone an idea how to get rid of this or track the origin of it ?

Thanks for any ideas (except "get rid of express .vi"; I know...)

N

0 Kudos
Message 1 of 10
(2,946 Views)

Many different functions in LabVIEW can return an error 1, for different reasons - a common one is trying to do an operation on an invalid reference of some sort. It will be difficult for anyone to provide meaningful help without more details - Can you provide more details on the error? On what your code does? Can you share the code?

0 Kudos
Message 2 of 10
(2,938 Views)

Hi

Thanks for the input. (the code is huge.. several hunderth vi 🙂  with about 12 hardware pieces synchronized). As I said, it worked fine before for 3-4 years, I do not believe there is a problem with the code.

I tracked the error to write to file express.vi

After I posted the question I was thinking it might be related with "sleep" or other power management in win 10, I gave rid of everything. Now waiting for the next error.

N

0 Kudos
Message 3 of 10
(2,933 Views)

Hi

I stumbled upon

https://forums.ni.com/t5/LabVIEW/LabVIEW-and-File-Folder-Permissions-Issues-in-Windows-10/td-p/37890...

maybe it is related to the same problem here (although I don't quite understand why the error appears only from time to time)

regards

0 Kudos
Message 4 of 10
(2,920 Views)

Hi

After 20554 seconds of working properly, both express vi throw an error.

No error before entering Express.vi. Is win10 locking files ? Antivirus ?

Clueless.

I

error 1.PNG

0 Kudos
Message 5 of 10
(2,883 Views)
Solution
Accepted by topic author nitad54448

Hi

I found out finally what was the problem :

-There was one error in a device before the WriteExpress. after the error boolean input in Write to File express.vi is TRUE, the express does not work anymore.

I am not sure this is how it is supposed to work. Here is a short vi to reproduce this error.

After starting, the program saves a random number to a file for every half a second.

Change the state of Error in boolean, you'll get a Error in th output of the Write express (code 0).

Then Remove the error in the input.

Write express gives error 1 even though (apparently) there is no error in.

Regards

0 Kudos
Message 6 of 10
(2,877 Views)

Well now you know why you should get rid of Express VIs. These VIs try to be a wool producing chicken porc that tries to provide almost everything for everyone. It makes their implementation terribly complex so that it is almost impossible to review them and to test them for every possible combination of inputs.

Looking at the implementation in question it gets quickly clear why this happens as the VI stores internally the last path used to shortcut some path finicery when it does not change between calls. BUT when there is an incoming error, it clears that path and then the logic is not quite up to snuff to recover from that when it is next time called without an incoming error. The VI in question also looks like having been amended over and over again with "fixes" to such problems that make the entire operation pretty much impossible to verify anymore. A complete reimplementation would be the only useful remedy for this. But I won't touch that VI even with a 5 foot stick and definitely not for use! Smiley Very Happy

Rolf Kalbermatter
My Blog
Message 7 of 10
(2,869 Views)

Hi

You are right.. I have to get rid of these. I've made this morning a small FG that saves data in a given file. I will gradually replace all my Write Express stuff.

However, I think it is not a correct behaviour of this express vi, since an error in another module can broke the "file reference" then in a subsequent call even if there is no error at the input, the express vi gives Error 1). I think, at least, this should be documented.

Thanks for your comment 

Regards

0 Kudos
Message 8 of 10
(2,859 Views)

@nitad54448 wrote:

Hi

 

However, I think it is not a correct behavior of this express vi, since an error in another module can broke the "file reference" then in a subsequent call even if there is no error at the input, the express vi gives Error 1). I


Yes.  I would consider this a bug within the Express VI.  There have been others in the past.  Sometimes they get fixed.  Sometimes other ones get introduced.

 

The best solution is to not use it.

0 Kudos
Message 9 of 10
(2,848 Views)

@nitad54448 wrote:

 

However, I think it is not a correct behaviour of this express vi, since an error in another module can broke the "file reference" then in a subsequent call even if there is no error at the input, the express vi gives Error 1). I think, at least, this should be documented.

 


Of course. It's a bug! But after looking at the diagram I feel that any attempt to fix it has a very high chance to cause another bug or maybe "only" uncover other bugs in the code.

Rolf Kalbermatter
My Blog
0 Kudos
Message 10 of 10
(2,833 Views)