LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write to measurement file vi bug?

Solved!
Go to solution

Hi.

 

Seems I might not be the first with this.  I suspect...

http://forums.ni.com/ni/board/message?board.id=170&message.id=234485&query.id=1018110#M234485

 

I have still after I don't know how many days hours etc, failed to make this work.   I had to go and do some "real" work as it's called here for a few days or so, not playing with software, despite this is what I've been asked to do.

 

All this is relating to the "Write to Measurement Data File" express VI that ships with LV 2009.   Used as called out in the infamous "Getting Started with LabView" document.   Running on XP Pro, fully up to date (until tomorrows "Patch Tuesday" perhaps.)

 

The Write to Data File Express VI:

 

It works the first time, no error, plenty of data, the first time the Enable input is made true, even if I leave it true, it happily creates many kB of file full of data just as expected.   Make the Enable input False, the writing to the file stops, again just as expected.

 

Make it True again, and <not a path> error is produced (the input file path\name etc is still there and just as valid as it ever was) and no data is written to the file, dispite no changes to the inputs of the VI (except for the single signal data value)

 

If however you give it a new (same path\new file) filename then it will write to the new file each time.  This is without shuting down the program as a whole.

 

I can cycle between two files just fine like that.   But it just will not write to a file the first time it is "Re"enabled after a disable is used.  Re entering the same path\filename is not a fix either.  It has to be a different one to wake the thing up.

 

As it is, it's worse than useless for any serious application, and like the other correspondent, I can't imagine how this got through the QA mill.   Like the other correspondant, this is all sold on the fact that it's suposed to be easy to plant objects/icons whatever on the BD and join the dots to make things work.  While largely true, and there is a lot of good stuff here, there are lots of things that exist to trip up and confuse.   Help is minimal too.  I get phone call's and email's to from other NI types, but no fix for the problem.

 

If you want a copy of the program VI whatever it's called fine, just someone tell me what and how to upload it to this (very strange) forum.  I can upload images, but I cant find a way to "attach" files etc.  Or work through the Getting Started document (as I have now, three times!) and you'll find the problem.

 

Oh, and I seem to have lost the indicator as to how many "evaluation" days I have left.  I can't find a switch to bring up that grey startup splash screen any more.

 


Regards.

 

Dave Baxter.

Technical Manager:

AR-UK Ltd.

 

OK... Who let the smoke out?
Message 1 of 30
(6,539 Views)

Hey Dave,

I'll have a look into this for you.  I've just quickly thrown together a VI with a write to measurement file and an enable/disable button but I can't seem to replicate your problem.  Prehaps you can attach your VI so I can have a look at what you're doing.  

To attach files you need to click "Add Attachments" you can find this below the "Tags" text box, which is below the "Post" and "Cancel" buttons. 

 

Kind regards,

Dominic Walker
Cardiff University
Electrical and Electronic Engineering Student
0 Kudos
Message 2 of 30
(6,502 Views)

Hi...

 

Attached, perhaps, as a zipfile.   See what you can do with that, and excuse my messings, trying to figure out what/why etc.  That .vi file is as created by LV2009.

 

There are screen layout funnies with this forum too, when you use a laptop with a "wide" screen.   Several options fall off the bottom of the universe, and the scroll bars are almost invisible (low contrast.)

 

Regards.

 

Dave Baxter.

 

OK... Who let the smoke out?
0 Kudos
Message 3 of 30
(6,487 Views)

Dave-

 

Looks like you took my advice about exploing the "Tools> Options" menu. When LabVIEW is launched a number of parameters are read from the LabVIEW.ini file located at :\programs files\national instruments\labview x.x\ .  To re-enable the "getting started screen"  click Tools> Options select Enviornment and uncheck the forth item "Skip getting started window on launch"  Take some time to browse the rest of the optins too!

 

As for attaching a file look below the message editor as you are editing a post.  Right below the edit box you will see Tags and a input area below that is an add attachment link that opens a pop-up to att attachments.


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 30
(6,484 Views)

Hi Jeff..

 

Sadly, close but no cigar.   All that does (was not ticked) is cause LV to start a new project when you launch it.   I have still "lost" the indication of how many days left I have.

 

 

As you may have seen, I found the attachment link.  As mentioned earlier, half the problem is the colour scheme of this forum, very poor contrast on a LCD screen, so I don't always see the scroll bar on the right, and fail to find any tools/buttons that fell off the bottom of my universe.

 

Using Firefox V3.0.x   IE is no better, in fact IE8 is worse!

 

Home time now, another day gone.

 

Cheers.

 

Dave B.

 

 

 

OK... Who let the smoke out?
0 Kudos
Message 5 of 30
(6,474 Views)

Dave-

It looks like you have improperly configured the write-to measurement file.  See the attached mark-ups.

 

the variable "filename" is misleading what is needed is a path not a filename- I hate it when developers do that! 


"Should be" isn't "Is" -Jay
Download All
0 Kudos
Message 6 of 30
(6,469 Views)

Indeed, but it does that by itself!

 

I have (if you look at the BD) an "Input" to that vi, with the full path and filename specified.   The help says that will overide any settings in the vi's properties, and it indeed seems to do just that.

 

However...   Regardless where the file path/name is specified, it works once, and once only.   Belive me, been there tried that soooooooo many times...

 

Try running it, and clicking the rocker swich.  I'll write to the file the first time just fine.  Unclick it, the file is closed and you can open it with notepad or similar.  Close Notepad (no sharing violations) and then try to click the rocker switch again.  It fails.  Unclick it.   Change the name, click the switch, it works.  Unclick, click, it fails.   Change name back to what it was, click, it works!!!!!!!    Why this odd behaviour?   It's useless to anyone like this.

 

Right.  It's 17:35 hear and I'm off home now.

 

Cheers.

 

Dave B.

 

 

 

OK... Who let the smoke out?
Message 7 of 30
(6,458 Views)
Solution
Accepted by LandyRover

I think there is definitely a bug.  I can see where it is happening, but I'm not sure why it got that way.  Does this VI show the bug in LV 8.6 also?

 

Right click on the Write to Measurement File Express VI .  Inside of that is a subVI called ex_subFileWrite.vi.  It is a clone of a reentrant VI, so it is kind of difficult to track the execution through it.

 

Somehow the first time through it builds and checks the filename based on what is coming into it.  It stores that in a shift register.  If you disable writing to a file, the shift register gets stored with a Not a Path constant.  Later, when the Write is reenabled, it just uses the path (Not a Path) from the shift register rather than going back to the input filename again.

 

Exactly where this really falls apart, I'm not sure, because that express VI is such spaghetti code with inter-twisted logic to handle all the types of files and file writing conditions and a lot of file path manipulation.

 

I think the reason that modifying the path and even changing it back works is that there is an upfront check of whether the path is the same and if it is different, then it works with the new filename, if it isn't, then it works with what was stored in the shift register.

 

Someone from NI should look deeper into that background code of the Express VI and try debugging.  I think there is a bug in there.

 

But here is a work around.  Use a select statement to send in the correct filename if the write is enabled, or an empty file path if it is not enabled.

 

Message Edited by Ravens Fan on 11-10-2009 09:25 PM
Message 8 of 30
(6,440 Views)

Hey Dave,

I've had a look at your VI, and got the same error.  You're right, it is a bug.  There is already a CAR open for this, #192290, so R&D are working on it.  

Ravens Fan's work around seems to work well, hopefully you can use this until the bug is fixed.  

 

Kind regards,

Dominic Walker
Cardiff University
Electrical and Electronic Engineering Student
Message 9 of 30
(6,426 Views)

Hi...

 

That indeed confirms my suspisions, and your solution workaround works OK, so I've flagged it as that for now.

 

But, as you say, it should be looked into, as it's a critical failure for newbies (such as myself) who expect at least the turorials to work as expected.

 

As you've confirmed it as a bug, do I get some more free evaluation days?  😉    As this has effectively stopped me working with it for well over 10 days or so.

 

Cheers n beers.

 

Dave B.

 

OK... Who let the smoke out?
0 Kudos
Message 10 of 30
(6,394 Views)