LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Permanent network access

I know this question seems only marginally related to CVI but I hope somebody will be able to drive me in the right direction.
 
I am developing an application for endurance tests that has to periodically generate (every 1 minute) on the plant network a file with the status of tests under execution. The mode I am doing it at the moment is by fopen-ing a remote file on a server and fwrite-ing a bunch of records in the file. This system works well for more or less 64 hours, after which I begin getting a "Invalid path" error in fopen. This behaviour is consistent and repeteable; it seems related to life of the program, since if I simply close and rerun the program the error disappears. The error is not related to a disconnection of the user connected to the system (a win2k machine with SP4 installed) since while the error is on I can browse the network and access the server directory on windows explorer. Moreover, the user account is setup to never disconnect on the server (a win2k advanced server machine).
 
Any idea? Any suggestion?
Thanks to all


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 1 of 13
(4,124 Views)

Hello Roberto,

it's just a wild guess, but I always use the CVI File I/O Library functions (OpenFile, ReadFile, WriteFile, CloseFile, ...) instead of fopen, fwrite, ... There might be a chance that you won't get the error using these functions.

Message 2 of 13
(4,128 Views)

Wim, it's pretty simple to give a try to your suggestion.

Unfortunately I won't be able to give you a feedback in less than 65 hours... Smiley Indifferent

Don't expect any star before this time Smiley Wink



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 13
(4,124 Views)
OK, I'll be watching the clock Smiley Tongue
0 Kudos
Message 4 of 13
(4,126 Views)

Ok, modified the program, made some error checking...

Countdown starts...

Three

Two

One

NOW!

Smiley Happy



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 5 of 13
(4,113 Views)
If I read this right, you are opening the file and leaving it open the whole time, yes?
 
If so, it might be a good idea to close it periodically and re-open it again. Just a thought if the use of the other functions does not help. Too bad it takes so long for the problem to manifest.
Martin Fredrickson
Test Engineer

Northrop Grumman
Advanced Systems and Products
San Diego, CA 92128
0 Kudos
Message 6 of 13
(4,097 Views)

Thanks Martin for considering my problem. Unfortunately not: I am opening and closing the file each time I update it, since other applications need to manage test situation and integrate with it other test results.

I agree with you; too bad it takes so long for the problem to manifest. At least this problem is constant, should it be erratical it would be the worst of all!

 

One little item to note: when the problem starts, the file on the network is truncated to zero lenght. It seems that something happens on the network folder even if I get the invalid path error qhile opening the file! Smiley Surprised



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 7 of 13
(4,092 Views)

No problem Roberto, I like a challenge. Smiley Happy

Well, since my assumption was incorrect, I'm now thinking it might be something in the OS. I'm not sure how NI implemented the functions in the File I/O library, if they use the ANSI functions underneath the hood, you may run into the same problem with them.

Hopefully they will solve the problem. If not, I am at a loss to suggest a course of action. Perhaps copying the result file to a temporary file, writing to that and then replacing the result file only if the new file is larger may give some insurance against losing data.

Martin Fredrickson
Test Engineer

Northrop Grumman
Advanced Systems and Products
San Diego, CA 92128
0 Kudos
Message 8 of 13
(4,091 Views)
It's time to grant Wim his stars: my program is running past 78 hours working without errors! Smiley Happy


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 9 of 13
(4,056 Views)

Thanks a lot Roberto Smiley Wink

I'm glad it keeps working.

0 Kudos
Message 10 of 13
(4,051 Views)