LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem about data in "real time"

Echoing SteveM, if you are doing any serious data acquisition work in LabVIEW, you should not use what I call "The Dreaded DAQ Assistant", particularly if you want to do continuous data acquisition at a reasonable rate and "do other things" at the same time (such as saving the data to Excel).

 

Open a Web Browser and do a search for "Learn 10 Functions in NI-DAQmx", read the excellent NI White Paper, create a Task in your Project (you are using LabVIEW Project, right?) that defines the DAQ device, channels, sampling rate, sample type, etc., then write your code with at most 4 or 5 DAQmx functions (with DAQmx Read inside a While Loop, preferably configured as the Producer of a Producer/Consumer Design Pattern).

 

Bob Schor

Message 31 of 58
(1,750 Views)

Hi Steve,

 

Sorry for the late, I wasn't working this week end :s 

 

Well I received your code, I'll try to run it this morning. At tried just once without change the setting and I got an error with the release queue. 

 

I'll change my settings, it's probably because of that 🙂

 

I'll give you some news later ! 

 

Thank you,

 

Maxime

0 Kudos
Message 32 of 58
(1,720 Views)

Hi Bob,

 

Thank you for this advice. I'll try the solution that Steve gave me just before, and I will read the website that you told me in your message 🙂 I just look at the website a few time, that's true, he looks very interesting ! 

 

Regards,

 

Maxime

0 Kudos
Message 33 of 58
(1,719 Views)

Well... I still got the same error 5 with the new example that you gave me friday. 

 

I tried to change settings, many different thing to find a point which could be explain this error but it doesn't make any sense, whatever my values, I always got the error but sometimes she is display immediatly and sometimes it's like 3s after the run VI. I don't understand. 

 

I put my physical channel and didn't forgot one, I gave a name to my file too. The problem is link with the release queue, but I don't understand why. 

 

I never used the release queue before, I tried to find an other way (supposing that I understood this VI 🙂  ) but I didn't... 

 

Finally the other program, the old, is working for now a little better even if it works ramdomly -_-. I'm still searching a solution or at least an explanation about the last program ( DAQ Multi Tasks) maybe did i forget something ? I don't know... 

 

Regards,

 

Maxime

0 Kudos
Message 34 of 58
(1,711 Views)

Maxime,

 

> Well... I still got the same error 5 with the new example that you gave me friday. 

 

There should be some description along with the error code.

Can you check on that? Otherwise it's hard to know what the error means.

 

Looking at the DAQmx Multi tasks.vi I sent, there are a couple of things that could be better.

 

The error line that looks like it goes through the Enqueue Element actually passes behind it.

The merging of DAQmx errors with the Queue error line should not feed into the Queue error

going out of the while loop. (Check the enclosed image.)

The queue reference should have shift registers at the sides of the while loop.

(Right-click and select  "Replace with Shift Register" then click on the other side.)

 

DAQmx Multi1.png

See if this makes a difference or at least helps narrow down the issue.

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
Message 35 of 58
(1,705 Views)

Hi Steve,

 

Sorry I didn't give you the description cause it was the same  than the old program.

 

This is the description :

error 5 :write in a measure's file3 -> Bilan Excel Final.vi  

Possible reasons : LabVIEW : the file is already open (and he is not, that's sure) 

=============================================

NI-488 : The command needs the controller GPIB as a controller system. 

 

I hope that it can help 🙂

 

I had a question about the samples by channel. I don't really know which value should I put on this setting. It can be maybe a reason of the error I don't know...

 

I'll try your solution this morning ! 🙂 Thank you again and again. 

 

Regards,

 

Maxime

0 Kudos
Message 36 of 58
(1,688 Views)

Hi Maxime,

 

Maybe the file is corrupt. I think it tries to rename the existing file so it can make a new one with

the same name. Try deleting the file. (As a test you could try to open it with Excel first.)

 

> I had a question about the samples by channel.

 

I think you mean "number of samples per channel". This is the number of samples that will be gathered in each

loop iteration. If you have Sample Rate set to 10000 and "number of samples per channel" set to 5000,

then the acquire loop should take 0.5 seconds - does that make sense?

 

Hint: Keep the "Context Help Window" open (Click on the question mark - upper right).

Hover over the item the wire goes to. If there is a "Detailed Help" link, open it.

If you do this, you will become an expert in no time!

 

Also open the "Init" vis and do the same thing. You should find they are not too complicated.

 

I think you are close.

steve

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
Message 37 of 58
(1,682 Views)

Well, I did exactly what you said in your last message. But it doesn't make difference unfortunately... I tried to change my sample rates, etc. But it changes anything... I'm really disappointed >< I don"t have the level to solve this problem and end this project, really... 

 

I'm searching, and not only waiting your solution, but my skills with labview are really too basics ><

 

 

 

 

0 Kudos
Message 38 of 58
(1,681 Views)

Oh wait I didn't do your last advices 🙂 The answer was only about the old message. Don't consider it about your last ! 

 

I'll read it and try, let me some time :3 

0 Kudos
Message 39 of 58
(1,680 Views)

>Maybe the file is corrupt. I think it tries to rename the existing file so it can make a new one with

the same name. Try deleting the file. (As a test you could try to open it with Excel first.)

 

I don't know... in the block : "write in a measure file" I put in settings : if the file already exist : erase the file. 

And in the blue frame I just gave the same file's name than in the measure file. I hesitated, I remembered that a blue frame like that was to give a way for the file. But I don't know. 

 

 

0 Kudos
Message 40 of 58
(1,677 Views)