03-30-2016 01:27 PM
I am currently using Labview with S Series card and I am coming across an error that doesn't seem to occur with an X Series or E series. The purpose of the code is to be able to have two lines of code running simultaneously. I want to be able to continuously acquire samples from one analog input; the second channel of acquisition is to be triggered using a condition met from the first aforementioned analog input.
Attached is the code that I have been drafting, the issue with using two sample clocks is an error pertaining to reserved resources. The code below shows both virtual channels collected into the same task, is there a way to have two distinct tasks/channels that will function in the way described?
03-30-2016
02:47 PM
- last edited on
11-21-2024
09:02 AM
by
Content Cleaner
look this page
03-30-2016 03:35 PM
@labm8 wrote:I am currently using Labview with S Series card and I am coming across an error that doesn't seem to occur with an X Series or E series. The purpose of the code is to be able to have two lines of code running simultaneously. I want to be able to continuously acquire samples from one analog input; the second channel of acquisition is to be triggered using a condition met from the first aforementioned analog input.
Attached is the code that I have been drafting, the issue with using two sample clocks is an error pertaining to reserved resources. The code below shows both virtual channels collected into the same task, is there a way to have two distinct tasks/channels that will function in the way described?
OK that was fun!
As you know you can only have one AI task per device so, you need to process the data to remove the stuff you don't want.
Thusly:
03-31-2016 11:19 AM
Thanks, Jeff!
Can you elaborate a little more on the process behind the Trigger and threshold 1D array function (part b)? It's to my understanding that our specific trigger is to collect a finite number of samples of interest (extracting from the 2nd array) for every instance a trigger condition is met on the first acquistion channel (1st array).
Thanks again.
03-31-2016 12:02 PM
@labm8 wrote:Thanks, Jeff!
Can you elaborate a little more on the process behind the Trigger and threshold 1D array function (part b)? It's to my understanding that our specific trigger is to collect a finite number of samples of interest (extracting from the 2nd array) for every instance a trigger condition is met on the first acquistion channel (1st array).
Thanks again.
Sure What that little piece of the puzzle does:
The first acq channel data is extracted and passed into Threshhold 1D array. Each element of the array is compared to the threshold value until two points are found where there is a positive crossing of the threshold the fractional index of the crossing is returned (eg the array is [1,2,3,4] and the threshhold is 2.65 the fractional index is 1.65 since the crossing is at 65% if the difference between elements 1 and 2)
If no crossing is found the returned index is the index of the last element of the array. We use that value (coerced to I32) to start picking off elements from the second 1D array.
04-01-2016 11:28 AM
If the first array is periodic, is there a way to account for the descending values as well (i.e. rising and falling slope) when using the threshold palette?
04-01-2016 02:37 PM - edited 04-01-2016 02:42 PM
Do you need to trigger on both slopes? If so, yes there is. just negate the array and use an appropriate threshold for the negative going trigger.
You will want some hystresis between the thresholds to account for noise brb
04-01-2016 02:49 PM - edited 04-01-2016 03:04 PM
Both slopes with hysterisis
Note: the difference between Samples in acquisition and Samples to capture after trigger is now your "Retrigger Blanking period" We could ajdust that by the pseudo code
If "Leftovers" >0
N Samples per ch = Leftovers +Retrigger Blanking Period
Else
N Samples per ch = Retrigger Blanking Period + Samples to capture
And then use Retrigger Blanking Period + Samples to capture as the samples to acquire input into DAQmx Timing.vi
04-01-2016 03:29 PM
As a matter of fact that was such a good idea
Any more "Scope Creep" or have I met spec yet?