LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issues logging data - does not save the correct data

The logging will occur when the samples are available and when the logic conditions are met. You need to understand data flow. If, for example, you have a 10 kHz rate with 1000 samples, it will take exactly 100ms for the read to return the data. If the logic goes true at 50 ms, the write will not occur immediately.

I don't think the old code was doing a continuous acquisition but it has been s very long time since I used the obsolete driver.
0 Kudos
Message 11 of 20
(690 Views)

Dennis, in your example, does that mean there will be a 50ms lag?

0 Kudos
Message 12 of 20
(661 Views)
What I'm saying is that the logging will not occur until the data is returned. You can wire a constant to the logging case but that won't change when the data arrives.
0 Kudos
Message 13 of 20
(646 Views)

OK thanks, I think it is starting to make sense.

 

What do y'all suggest I do for my program, however? It is important that the logging is lossless, the graphs could be lossy..

 

It is important that my logging gathers exactly what I need, right when the logic occurs.

 

As I understand,  you can only have one of the tasks in the reserved state at a given time depending on hardware. I cannot have a task start when there is already one running (two AI tasks)

 

I tried running 2 separate DAQmx Create Tasks. One to do 'continuous' read (for my UI plots) and then 1 to do the read exactly when logic goes true, but I was getting resources reserved errors.

 

I would like everything to be continuous and my logging to not interfere with anything else ;/

0 Kudos
Message 14 of 20
(621 Views)
It sounds to me that you really need the acquisition to start immediately with the trigger condition, not the logging. Otherwise, you could continuously acquire and save the trigger time in the file. You would have a marker to indicate pertinent data.
0 Kudos
Message 15 of 20
(608 Views)

What are you calling the 'trigger condition'? When my logic from the 'Injection' goes False?

 

That is what I had prior to running into issues:

 

I was starting my task and acquiring via DAQmx Read.

 

The problem I ran into was when I had to add more to the code - the continuous acquisition of an additional channel.

0 Kudos
Message 16 of 20
(601 Views)
The trigger condition is what you have defined as when to start logging.
0 Kudos
Message 17 of 20
(593 Views)

Ok, great, that is what I was doing.

 

I was creating my task, starting it, reading, and stopping -  all when my trigger condition happened.

I was doing a finite acquisition based on 'seconds * 1000' to log the exact amount of samples desired.

 

This was on AI0.

 

I then needed to also continuously plot AI1. That is what brought me to the problem I currently am having.

Any advice?

0 Kudos
Message 18 of 20
(588 Views)
If your daq device supports it, another option might be hardware timed single sample mode. This would have the minimum delay between a read and the write to file.
0 Kudos
Message 19 of 20
(586 Views)

I understand that, I guess what I do not understand is:


How do I continuously acquire and plot Channel0 while logging only certain portions of Channel1?

0 Kudos
Message 20 of 20
(582 Views)