12-08-2020 03:41 PM
Hi,
Based on this example (https://forums.ni.com/t5/Example-Code/Synchronize-Analog-Output-Sample-Clock-With-TTL-Pulse-Count/ta...), how could I determine the actual AO rate (or period, or frequency)? I have measured the AO period through the oscilloscope, dwell time of each "pixel" is 1ms. However, I have no idea how to adjust this value?
-Crystal
12-09-2020 04:52 AM
After checking out the linked example and your comment at the tail end, I think there are 2 distinct answers you need. (Please keep any followup discussion here -- that other thread is mainly an example, not the best place for ongoing discussion of your particular related problem).
1. The 'update rate' in the example is the AO sample rate. If you are measuring 1 msec, it must be set for 1000 Hz. If you set it for 2000 Hz, your scope will show 0.5 msec. And so on.
2. The frequency of the sawtooth waveform you generate is distinct from but *dependent* on knowing this sample rate. There are vi's in the Signal Generation palette that can generate a sawtooth pattern of data. The combination of the # samples per sawtooth cycle and the analog output sample rate will determine the frequency of the sawtooth pattern.
For example, let's say you have a 100 sample pattern to define your sawtooth. Generating AO at 1000 Hz means you'll get a 10 Hz sawtooth. Generating at 2000 hz will give you a 20 Hz sawtooth. And so on.
-Kevin P
12-09-2020 02:49 PM
Hi Kevin,
Thanks for the reply. It works! However, I have another two questions come up.
1.The maximum update rate for PCI-6733 should be 1000 kS/s. However, the maximum update rate I can use is 10kHz. If I set 100kHz, the 50 sawtooth waves I generate will become one large square wave instead of 50 sawtooth functions. It seems like it cannot be resolves. How can I get a 1000kHz update rate? (I only use 2 AO in PCI-6733)
2. I set the max voltage for both X and Y to 1V. The output indicator shows the correct voltage. However, what I see in the oscilloscope is that max Y is 10V and max X is 1V. How can I fix this? Is this something related to the max and min voltage when I create the virtual channel?
Thanks a lot!
-Crystal
12-09-2020 03:16 PM - edited 12-09-2020 03:21 PM
@Kevin_Price wrote:
After checking out the linked example and your comment at the tail end, I think there are 2 distinct answers you need. (Please keep any followup discussion here -- that other thread is mainly an example, not the best place for ongoing discussion of your particular related problem).
-Kevin P
Actually, it can be split.
Go at Kevin! I am going to learn something here
12-11-2020 07:30 PM
1. I can't really begin to guess unless you post the code. Before you do, set your front panel controls to the values you want to use for the discussion, go to the "Edit" menu and select "Make Current Values Default". Then save the vi and post it.
Of note: the linked and confirmed example code has an 'Update Rate' control on the front panel. Your screenshot does not. Instead it has a 'Dwell Time of each pixel' control. Clearly, you've made *some* changes and I have no way of knowing what they are.
2. Sounds to me like a problem with the probe config on your scope. The Y channel is probably configured wrong, telling the scope it's 10x when it should be 1x (or 100x when it should be 10x).
-Kevin P
12-14-2020 04:43 PM - edited 12-14-2020 04:43 PM
Hi Kevin,
I've attached the vi file. The second question has been solved. For the first question, dwell time is the derivative of the update rate.
I found that if update rate is higher, the number of X and Y steps should be higher enough to output a nice or correct sawtooth wave. So the update rate can go more than 10 kHz but the # of the steps need to be higher as well. I don't understand that why I need to increase the # of the XY steps to resolve the output sawtooth.
The parameters I need are 500 kHz update rate and 500 of # of XY steps.
For example, if # of steps is 500 and update rate is 500 kHz (dwell time = 0.002 ms), the sawtooth wave will become uneven and the voltage is not ranging from -10 to 10V.
If # of step is 1000 and update rate is 500 kHz (dwell time = 0.002 ms), the sawtooth wave will be better than the case # of steps = 500 but the voltage is still not ranging from -10 to 10V.
If if # of step is 2000 and update rate is 500 kHz (dwell time = 0.002 ms), the sawtooth wave is correct.
Is there any way to fix the problem of uneven sawtooth wave at the high update rate?
Thanks!
-Crystal
12-15-2020 06:20 PM
I removed all the DAQmx calls from your code b/c I don't have DAQmx installed for LV 2020. All the examples you listed result in expected sawtooth patterns in the GUI graph indicator. So the problem doesn't seem to be in the raster pattern calculation vi.
So that points to some kind of hardware related problem. Look directly at the AO output signal while NOT connected to other equipment. If things look right, then your DAQ device and external equipment aren't compatible for what you're attempting.
When you have a bigger ratio for (update rate) / (# steps in sawtooth pattern), it means that you're trying to generate a higher frequency sawtooth. Apparently the combo of your DAQ device and your equipment has some limitation that prevents the the sawtooth ramp rate (aka slew rate) you're trying to achieve. 500 steps at 500 kHz is a 1000 Hz sawtooth. Note that the scope can't slew from min to max AND that the downslope is very limited instead of nearly a vertical line.
That's a hardware limitation.
Note that with hardware unable to follow at <1000 Hz, there's little sense in a 500 kHz update rate. Your apparent success showed up with a 250 Hz sawtooth. So the ramp rate limitation would seem to be somewhere near 20 V / 4 msec.
I still don't know if you're measuring an output of your equipment or if you're measuring the DAQ device's signal output while connected to an input of your equipment.
-Kevin P
01-29-2021 05:27 PM
Hi Kevin,
Sorry for the late reply.
I measured the DAQ device AO without connect to any device. Is it the limitation of PCI-6733? Is there any method to generate higher frequency sawtooth?
Thanks!
-Crystal
01-30-2021 09:33 AM
Specs for the 6733 rate it for 15V per microsecond, so this *shouldn't* be an inherent limitation of the DAQ board. Not sure what else to say at this point, except to try other things to troubleshoot. What happens if you generate a square wave? Can you find a pattern to the anomaly as a function of frequency and/or amplitude? Have you tried changing various scope settings or using a different (known-good) probe? Do you have an analog input DAQ device you could connect to as an alternate measurement method? Etc.
-Kevin P