LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[LabVIEW Bug Report] The Specified Device Name is Invalid

I'm not sure if this is old hat, but it was the cause of some recent frustration on my part.  I was creating several thousand files based on common stock names, when my previously working program started to hang suddenly, at apparently the same point.  The running LV 2014 VI never recovers, the Stop button becomes non-functional and I have to kill it via the Windows Task Manager.  It turns out a new name, "PRN" came up in the database I was using to create these new files from. Investigating, I attemped to manually create the file, which resulted in my Windows 7 Professional system indicating "The Specified Device Name is Invalid".  Investigating the Windows error, I found on line that "Windows cannot create a file or folder named any of these keywords : CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9".  Probing on the diagram, I find the Open/Create/Replace File executes without output error - just LV hangs indefinitely when it tries to create the file named PRN.

 

So, what are the chances anyone (but me) is going to create a file using these particular names?  Still, I think LV 2014 should have handled it in a better way.  Of course, I dont know if a later version of LV fixes this "hang" from happening. Hope this helps someone here.

 

Whomever "PRN" is, they're going to be glad they picked that ticker...  On the flip side, all Windows users creating stock ticker named files are going to remember them!

Message 1 of 6
(3,575 Views)

I'm in Labview 2012 and if I try to create a file called PRN, it doesn't hang but immediately outputs error code 1. 

Example_VI.png

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 6
(3,564 Views)

Hi,

 

**EDIT: I should have read the first post more, but I can also confirm that LabVIEW 2016 throws Error 1 instead of hanging. It seems that later versions of LabVIEW at least handle the error instead of freezing up like your LabVIEW 2012 code is. **

 

This actually is a problem with Windows, heralding back from DOS 1.0. There are certain filenames that are reserved in Windows, and you actually can't create any type of file with that name. I just tried right-clicking on my desktop and creating a text file called "PRN.txt" and Windows threw an error, and will throw an error if you try to use any of the other "reserved" filenames as well.

 

Here's a list of Windows-reserved names that you can't use at all:

  • com1,
  • com2,
  • ...
  • com9,
  • lpt1,
  • lpt2,
  • ...
  • lpt9,
  • con,
  • nul,
  • prn

 

Source: http://stackoverflow.com/questions/122400/what-are-reserved-filenames-for-various-platforms

Jorr-El
Systems Engineer
Testeract: Automated Test Specialists
0 Kudos
Message 3 of 6
(3,512 Views)

@Jorr-El wrote:

Hi,

 

This actually is a problem with Windows, heralding back from DOS 1.0. There are certain filenames that are reserved in Windows, and you actually can't create any type of file with that name. I just tried right-clicking on my desktop and creating a text file called "PRN.txt" and Windows threw an error, and will throw an error if you try to use any of the other "reserved" filenames as well.

 

Here's a list of Windows-reserved names that you can't use at all:

  • com1,
  • com2,
  • ...
  • com9,
  • lpt1,
  • lpt2,
  • ...
  • lpt9,
  • con,
  • nul,
  • prn

 

Source: http://stackoverflow.com/questions/122400/what-are-reserved-filenames-for-various-platforms


Right.  And the OP did mention that in the above post.  But the fact that the code didn't output an error is strange to me because when I create a file called PRN, it does output an error code. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 4 of 6
(3,505 Views)

...Which is a lot different than "The running LV 2014 VI never recovers, the Stop button becomes non-functional and I have to kill it via the Windows Task Manager."  Glad to read your version (2012) works.

0 Kudos
Message 5 of 6
(3,478 Views)

I have LV Home edition 2014 and it throws an error 1 when trying to create a file named "PRN".

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 6
(3,460 Views)