LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph refresh rate and writing to text problem - error 5

Solved!
Go to solution

Hi guys,

 

I'm new to labview and have encountered a few problems when I try to write to file.  I'm using USB 6259 with Labview 2009 to aquire a number of channels which I want to analyse later in MATLAB, whilst simultaneously providing some limited real-time analysis.  The experiment involves the use of lasers to calculate the position of a spinning cylinder.  I've written a quick vi using DAQ assistant to aquire the channels and provide a polar plot showing the displacement of the cylnder as it rotates which is ideal.  The problem is that since the cylinder is rotating at up to 6Hz, the graph needs to update very quickly which I have achieved by using a low buffer size compared to the sampling freq (sampling freq between 5k and 10k, buffer around 200).  This doesn't seem like the best solution.  Also, when I try to write to text, the following error is shown after a couple of seconds: 

 

Error 5 occurred at Write To Measurement File->Displacement_Rig.vi, Possible reason(s):

LabVIEW:  File already open.
=========================
NI-488:  Command requires GPIB Controller to be System Controller.

 

Can anyone point me in the right direction?  I've attempted to create a producer/consumer loop configuration, but I'm not convinced that it works with my limited expertise.  I've attatched my vi, although I warn you, i am new to labview...

 

Cheers

 

 

0 Kudos
Message 1 of 4
(2,947 Views)

Oh my mistake, i'd just like to add that that was an old version.  Ignore the elapsed time and the loop configuration of the producer should be 'stop if true'.

0 Kudos
Message 2 of 4
(2,943 Views)
Solution
Accepted by topic author lpaza

Hello Ipaza,

I have looked at your VI and found that there are some issues in the architecture of your producer consumer loops.

 

You can get a pre built producer consumer loop using the templates on the start up screen.

I have copied the majority of your code in to one such template. Could you test this and let me know if this solves some of the issue.

 

With regrads,


Philip
Applications Engineer
National Instruments
UK Branch

===If this fixes your problem, mark as solution!===
0 Kudos
Message 3 of 4
(2,909 Views)

Thanks philip.k for your help.  The vi no longer throws errors at me and as long as the buffer size is > a tenth of the sample rate, everything works. 

 

Cheers

 

Luke

0 Kudos
Message 4 of 4
(2,889 Views)