LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does fopen "w" throw a FileExists error?

I am programming in CVI for Real Time.

The following line is throwing a File Exists error even though "w" is supposed to wipe the file contents and write a new file.  This doesn't happen on another controller of mine.  Any ideas?

 

InputFile = fopen("c:\\\\DDRT\\Configuration\\DDRTRunNumber.txt", "w");

 

throws:

 

NON-FATAL RUN-TIME ERROR:   "DDRT.c", line 3250, col 14, thread id 0x00000096:   Function fopen: (return value == 0 [0x0]). (EEXIST) File exists

Programming Data Acquisition and Control in Measurement Studio and Labwindows/CVI
0 Kudos
Message 1 of 6
(2,871 Views)

Hi Michael,

When you open the file after that error do you see that the contents of the file have been wiped and replaced?

0 Kudos
Message 2 of 6
(2,837 Views)

I found the reason but I need to know why...

 

I have a RT PXI system and I have to reference files with "C:\\\\....."  I don't know why the string is essentially C:\\

I have a loaner unit that is dual boot.  I'm running it in RT and I only need "C:\\...." 

 

Why the difference?  Both are supposed to be running LabVIEW RT 14.0.  Do they have different RTOSs?

 

Thank you.

Programming Data Acquisition and Control in Measurement Studio and Labwindows/CVI
0 Kudos
Message 3 of 6
(2,832 Views)

Can you verify that both your controllers are running LabVIEW RT 14.0 through NI MAX? Thanks.

0 Kudos
Message 4 of 6
(2,815 Views)

The monitor shows "Welcome to LabVIEW Real-Time 14.0" on the display signal coming from the PXI system.

MAX says LabVIEW Real-Time 14.0.0

Programming Data Acquisition and Control in Measurement Studio and Labwindows/CVI
0 Kudos
Message 5 of 6
(2,810 Views)

What are the models of both controller units?

0 Kudos
Message 6 of 6
(2,799 Views)