06-22-2012 03:29 AM
Hi Yan,
did you have success, with the generating of the multiple ramps?
Regards,
Christian
06-22-2012 09:29 AM - edited 06-22-2012 09:30 AM
hi christian,
thanks for asking. Actually, I think I've managed to get what I need from the other thread (old one) with help from an NI engineer (http://forums.ni.com/t5/Multifunction-DAQ/Generating-multiple-ramp-pattern/m-p/2037048#M71574). This is what I got:
It can build multiple ramps nicely at the same time. The key is: sample numbers must be the same for all ramps. I'm initializing high numbers for sample numbers (must be power of two), and then comparing this number to the samples of each ramps), then dividing the maximum samples thats been compared, then dividing it with samples of each ramps and then expanding the steps of each ramp.
This program runs pretty good if I want to generate just constants or ramps for all channels. But, if I try to generate sine wave, it sometimes very lagging, sometimes gives me error -200018, (which means my sample rates is too big?). I'm still trying to find solution to this. The pict on the right is the zoom pict of my signals.
Oh yeah, dont bother to see the big green button in the left of the pict, its using another NI card.
regards,
Yan.
06-29-2012 06:47 AM
hi all,
any suggestion how to add delay to a single channel? Is there any sub vi that can add delay to one specific channel?
regards,
Yan.
07-04-2012 06:34 AM
hi all,
I think I can get the delay with using two ramp pattern.vi. I use the 1st ramp pattern to generate 0, then the 2nd to generate ramp. Then using insert to array, then build waveform. But this means, I'm using only one dt. Which means, to have my multiple ramps working properly, the delay time and the ramp generating time must be quotient of 2. Otherwise, the sample numbers will not be shared equally in each ramp step. So confusing... 😞
regards,
Yan.
07-04-2012 08:38 AM
A few posts back you said "The key is: sample numbers must be the same..." That also applies here.
Suppose you have 10 samples so that the ramp values are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. Now if you want to delay that ramp by 3*dt, you put three zeros at the front while keeping the number of samples the same. The delayed ramp values are {0, 0, 0, 0, 1, 2, 3, 4, 5, 6}. The Array palette has several tools to manipulate the arrays to do this.
Lynn
07-04-2012 09:16 AM
hi Lynn, thanks for response.
I was thinking the same idea and I could manage to do such delay while generating finite sinewave (ex: 1000 cycles sinewave with 500cycles-delay gives me the delay+the rest 500cylces in output). But seems harder to apply to ramp.
If the input for generating ramp are:
- delay time (free selectable)
- ramp time from min to max
- min & max value
- sample numbers
and I want the ramp goes from min value to max value after delay time, is it possible? I keep thinking that the delay time cant be freely selectable, if I want to have equally samples amount in each step.
regards,
Yan.
07-04-2012 01:02 PM
Yan,
I think you are correct that you cannot independently specify all those parameters. The total time is specified by the number of samples and the sample rate. If you also specify the total time as the sum of the delay time and the ramp time, then you have a conflict unless both sums are exactly equal. If you also want a specified number of samples per step, you have an additional conflicting constraint.
Here is a quick example showing some possibilities.
1. A simple ramp pattern with the total number of samples is show for reference.
2. Using the Ramp Pattern VI and Initialize Array to generate simple delays.
3. A delay followed by a ramp with specified number of samples per step. Note that some "bookkeeping" is required to get the numbers of samples for each segment correct. Also many combinations of values do not produce a valid result. This example does no error checking and soe settings may crash the program with out of memory errors.
Lynn
07-06-2012 04:26 AM - edited 07-06-2012 04:27 AM
Hi Lynn, thanks for your small but inspiring program.
I can manage to get into the direction that I want. But still, with using 8 channels and generating signals from 6733, I can have maximal 2^19 samples/channel/second, right?
Now with my program, I can have the desired delay and ramp as long my delay duration is less than ramp duration. When I put delay duration more than ramp duration, I'm getting error: my sample numbers changing.
It's because I keep building my ramp using half of total sample numbers: 2^18 samples.
regards,
Yan.