11-23-2009 02:45 PM
We took this data on a digital channel at 9 Hz using the low pass filter on an SCXI 1125 set at 4 Hz and 10 kHz. Shouldn't the digital channel show to drop much more quickly on the 10 k setting? This seems entirely too slow. I've attached a graph with channels run using both cutoff frequencies.
I'm averaging 100 samples at a sample rate of 1 kS/s/ch at logging the data at 9 Hz. (continuous samples)
My code is as follows:
If .Device.Contains("SC") Then
Tasks(TaskCount).AIChannels(TaskChannelCount(TaskCount) - 1).AutoZeroMode =AIAutoZeroMode.None
If .FilterHz.ToLower = "low" Then
Tasks(TaskCount).AIChannels(TaskChannelCount(TaskCount) - 1).LowpassEnable = True
Tasks(TaskCount).AIChannels(TaskChannelCount(TaskCount) - 1).LowpassCutoffFrequency = 4
Else
Tasks(TaskCount).AIChannels(TaskChannelCount(TaskCount) - 1).LowpassCutoffFrequency = 10000
End If
End If
11-24-2009 12:15 PM
Hi Michael,
It doesn't look like your graphs attached- could you post those? Thanks!
11-24-2009 12:39 PM
11-30-2009 09:20 AM
Hi Michael,
I think I'm still a little confused with your setup. First, what are they axes on your graph? As well, can you explain what you mean by, "I'm averaging 100 samples at a sample rate of 1 kS/s/ch at logging the data at 9 Hz. (continuous samples)"- does this mean that you're averaging in software 100 samples at a time? Finally, is your 'digital data' line your theoretical of what you would like to see the blue line look like? Thanks!
11-30-2009 09:39 AM
Digital data is an array of booleans in the program that updates the digital port. It changes instaneously in the program and the state of the digital relays should change as soon as the hardware is updated. I update digital hardware 9 times per second.
I set up my analog task for a sample rate of 1000. I've been told that this number is configured on a per-channel basis. No matter how many channels I have, the task should run the ultimate sample rate at whatever rate necessary (within hardware limitations) to achieve that rate. Nine times per second I average the 100 readings per channel that I asked for. I can only assume that if I had a task with ten channels set at a rate of 1000 S/s, then it would read at a total rate of 10,000 S/s and return the data at 10 Hz if I am asking for 100 samples per read.
The reason I am running 9 Hz rather than 10 is because the timers in VB are limited in their accuracy and I can only achieve 109 ms periods. I've tried a different timer and I could ask for a 10 ms period and get 15, but if I asked for 100 I would again get 109. That is an entirely different issue.
For this issue, assume that I am closing a relay and that digital data is the state of that relay. The other line drops too slowly which tells me that it is filtered. The x axis is in 9ths of a second, so a distance of 9 over the x axis would correspond to 1 second.
12-01-2009 02:42 PM - edited 12-01-2009 02:43 PM
Problem solved... It was a short between the chair and the keyboard. Thanks for your help.
P.S. Please delete this thread so people don't look here to try to solve real problems. 😉