07-09-2015 06:31 AM
Hello,
I have a problem with error -50103.
I've looked through the knowledge base article but the answer is quite vague in terms of implementing a solution to my specific problem.
I am case 6 I think. Running two analog input tasks concurrently.
I have two separate sources of analog data which from the perspective of parameters are identical but critically they are completely unsynchronised. I need to acquire 1000 samples of data from each channel after a channel specific trigger event. Both channels are generating their data at the same frequency but because they are unsynchronised sometimes the input samples will overlap and sometimes they won't. I can acquire the data from both channels by sequentially starting and stopping the input tasks but that means I skip data in the situation when the two channels overlap.
I initialise each task with a create channel, channel timing and digital start trigger daq mx VI. I then attempt to start each task in parallel in a while loop so that each can wait for the start trigger. Both tasks are then stopped before the loop repeats the acquisition of the next lot of 1000 samples.
The sample of code which causes the error is shown below. If I start, stop one task and then the other sequentially there is no problem... but as described above this doesn't work for me as I miss triggers and data.
Any ideas?
Thanks.
07-09-2015 07:00 AM
The problem here is that there is only 1 ADC and sample clock on the DAQ board. So if one task reserves it, the other task will throw an error. You either have to turn it all into a single task (I don't see why this is an issue) or use a second DAQ board for the second task.
07-09-2015 07:07 AM
Thanks for the quick response.
If I turn it into a single analog input task, how can I have different digital start triggers for the acquistion on different channels?
07-09-2015 07:15 AM
@Ibboh wrote:
If I turn it into a single analog input task, how can I have different digital start triggers for the acquistion on different channels?
That's the part I was unsure of. If you have seperate triggers, then you need to use seperate DAQ cards.
07-09-2015 07:22 AM
Thanks again for your replies.
If anyone else knows a method without having to get two DAQ cards that would be appreciated.
07-09-2015 08:09 AM
07-09-2015 09:34 AM
Acquire four channels continuously in one task. Put the triggers on the two extra channels. Then search through the data for the trigger signals and extract the relevant data subsets from the corresponding data channels.
Lynn
07-09-2015 09:45 AM
Thanks for the last two suggestions (which I think are the same).
Anyone else out there know if there is a way to achieve this with finite samples acquisition?
The tests that I run result in a lot of data and the duty cycle is such that only acquiring 1000 samples with each trigger is just about manageable. But with continuous acquisition, the required sample rate would generate an order of magnitude more data. I'd either have to post-process and cut the data down in each loop which would reduce the post-processing capability for the other analysis required or I'd have to collect a huge amount of data.
07-09-2015 09:59 AM
What is your sample rate?
What is the maximum time between the trigger on one channel and the trigger on the other channel (regardless of which comes first)?
What is the minimum time between the last sample in one data set (two triggers and 100 samples on each of two channels) and the first trigger of the next data set?
Do you have any other way (besides timing) to identify the separate data sets?
If we know more about your test setup, we may be able to offer better suggestions.
Lynn
07-09-2015 10:24 AM
The parameters are varied... but as a typical example:
- Sample rate is 100ks/s
- Time between triggers can vary from 0 to 100 ms. Once the test is triggered this separation should stay roughly the same for each iteration of the trigger. But on reinitiating the whole test the separation will be something different as the two datasets are triggers are generated independently.
- The minimum time between the last sample in one data set and the trigger of the next is 0 ms. In fact the next trigger can occur during the sampling of the first dataset as the two are independent.