LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multitask DAQmx

Hello,

I'm working in this code but I have some problems. In this project, I'm acquiring two  analog signals (this signals are the same). My objective is  record  all the samples in a channel and the another channel that is the same signal I  want to record the samples when there is an postrigger.

Depends on number of  the samples,  the program execute 'Record all the samples' or 'Postrigger Samples' but  I want to execute both at the same time

My question will be. How could Record all the samples and Postigger samples execute at the same time? 

Any answer will be helpful.

Thank you so much.
Pedro

0 Kudos
Message 1 of 14
(4,456 Views)

Based on your code you are calling same channel in two places parallely and it will result in an error

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 14
(4,442 Views)

Hi,

Thank you so much for you answer. I did a new code with only a channel.  My idea is acquire a signal  (For example sine signal) and with this signal  record all the samples in mode continous in a place parallely and the another place paralley is recording postrigger samples.

Depend on number of the samples. Labview executes a place parallely or another place parallely. I would like to execute both parallely at the same time.

Thank you for your help .
Pedro

 

0 Kudos
Message 3 of 14
(4,434 Views)

What you could do is have your trigger signal go into another AI channel and then you just monitor it to go high.  You then log your data.  A Producer/Consumer setup would help.  The idea is that you have one task to read which can log all data and then use a queue to also send the data to another loop that can monitor the trigger signal and log the desired number of samples to a TDMS file.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 14
(4,428 Views)

Hi, 

Thank you for your help.

I understood your answer but I would like to  have a same signal where I can be recording  all the samples while  I'm recording postrigger samples (when there is a trigger) . Could I do in DAQmx?

Thank you.

Regards.

Pedro

 

 

0 Kudos
Message 5 of 14
(4,407 Views)

You could also just record the continous sample and the time when the trigger happens. Then use the time of the trigger to cut the continous samples to get the triggered sample.

 

Alternatively, you can use two Analog Input channels, one triggered and one recording continously. Use a jumper wire to physically connect these two Analog Input channels.

0 Kudos
Message 6 of 14
(4,393 Views)

@juanpedro14 wrote:

I understood your answer but I would like to  have a same signal where I can be recording  all the samples while  I'm recording postrigger samples (when there is a trigger) . Could I do in DAQmx?


Not purely in DAQmx.  You will need the other loop to log then "triggered" data.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 14
(4,387 Views)

Hi, 
Thank you for your answer, 

Could you explain better the alternative? Because, I have a channel for the Signal sine (for example) that I'm recording continously and another for the trigger. I don't understand very well your solution. If I connected a jumper to join two channel I will have the same signal in each channel. I'm not making sense your explanation. If you could explain again It will be very helpful

Thank you for your time.
Regards 

Pedro

0 Kudos
Message 8 of 14
(4,350 Views)

What I am suggesting is moving what you currently have wired to the PFI port (the trigger signal) to a second analog input.  You then have one task to read both and log everything.  You use a queue to send the read data to another loop that looks for the trigger line to go high and record the recieved data up to the desired number of samples.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 14
(4,340 Views)

@juanpedro14 wrote:

Hi, 
Thank you for your answer, 

Could you explain better the alternative? Because, I have a channel for the Signal sine (for example) that I'm recording continously and another for the trigger. I don't understand very well your solution. If I connected a jumper to join two channel I will have the same signal in each channel. I'm not making sense your explanation. If you could explain again It will be very helpful

Thank you for your time.
Regards 

Pedro


@I was thinking it the wrong way. You cannot have a task with one channel triggered and another channel not trigger. @crossrulz 's answer is way to go.

0 Kudos
Message 10 of 14
(4,326 Views)