07-12-2016 05:39 AM - edited 07-12-2016 05:41 AM
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
07-12-2016 06:02 AM
Based on your code you are calling same channel in two places parallely and it will result in an error
07-12-2016 06:24 AM
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
07-12-2016 06:42 AM
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.
07-12-2016 09:35 AM - edited 07-12-2016 09:36 AM
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
07-12-2016 10:25 AM - edited 07-12-2016 10:26 AM
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.
07-12-2016 10:50 AM
@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.
07-13-2016 06:52 AM
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
07-13-2016 08:23 AM
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.
07-13-2016 09:03 AM
@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.
RegardsPedro
@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.