01-21-2010 08:18 AM
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
Solved! Go to Solution.
01-21-2010 08:26 AM
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'.
01-25-2010 11:25 AM
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,
01-26-2010 07:09 AM
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