10-25-2012 03:25 PM - edited 10-25-2012 03:45 PM
Hi guys,
Thanks for Your help!
I'm sorry, you're right at the expense of the frequency in the sample Fgen Switch Between Waveforms.vi.
But to make it really hard.
I still do not fully understand it.
We have several modules 5422 with 512 MB.
I think now should be enough memory.
And how matters stand with module PXIe 5450.
Is there a suitable example to realize this task on it?
Although it has a range of 0.707 - 1,005 V, but I think that's enough.
Regards,
Engineer and software developer,
TeSLa.
10-26-2012 08:06 AM
Hi Max,
I think I misunderstood your application a bit when I had recommended the 5450. I agree with Marcos that a function generator would be best. There are standard functions these can output with very simple properties you can change on the fly to achieve what you need here.
On your 5422, as Marcos and I have stated previously, you would need to allocate a waveform with a fixed set of samples for each frequency you need since sample rate is constant. You would then load all of these waveforms to your memory, assuming you have enough. At any time during generation, you can write a new set of points to any waveform that you pre-allocated (except for the one currently being generated), as long as you keep the number of samples the same (e.g. frequency won't change for a given waveform). This will allow you to change amplitude (digital or analog gain as Marcos explained in post # 20 and I explained in post # 19) and phase (as I explained in post #s 10 and 13).
If you feel uncomfortable writing this code yourself, I would highly recommend getting in touch with your local NI representative to see about hiring an NI Alliance Partner to help out with actually writing the code for this.
Regards,
10-26-2012 10:52 AM
Hi Chris,
Thank you very much! This solution is suitable.
And now I'm trying to implement it.
Here's the simple example, that I think will help in the future. But there was any problem.
VI is configured for 50 and 100 Hz, but can be seen on the oscilloscope frequency of 2kHz and 4kHz respectively. Can you check my code?
And stoping the generation occurs the error in the niFgen Abort Generation VI. What values are needed in my example?
Error -1074115901
Possible reason(s):
Device data underflow. The device was not able to move data fast enough to keep up with the sample rate for the active script.
Run the operation at a lower sample rate, or look for the following in the active script: markers might be too close together, waveforms might be too small, waits might be too short, or subsets might be too small. If you are using an external clock, the provided clock might have gone away during your generation.
Device: PXI1Slot6
Status Code: -200316
Regards,
Engineer and software developer,
TeSLa.
10-26-2012 07:15 PM
Hi Max,
Your 5422 is likely sampling at 200 MS/s by default. You are putting a sampling rate of approximately 5 MS/s into your Sine Waveform.vi. Since this VI expects sampling rate to be 5M / 200M = 40 times slower than it really is, I am not surprised you are seeing frequencies 40 times faster than you expect. Either adjust your 5422's sampling rate or change the sampling rate you are feeding to Sine Waveform.vi so these rates match.
I have since posted a Community Example showing basic phase shifting on an AWG. I would recommend using this architecture, with a waveform for each frequency you need, and then adding amplitude modulation to the code to achieve your goals.
Regards,
10-30-2012 05:46 PM
Hi Chris,
Thank you for your example!
May I ask you a some questions?
The module 5422 can change the voltage Vp-p in the range of -6 to +6 V.
But when I use the Property Node - Digital Gain, after setting the 1.2 V occurs the next error:
In niFgen Configure Arbitrary Waveform VI there is a parameter Gain to control the normalized signal (as I understand). Is there something similar for the Script mode?
How to access the Analog Gain?
And in general, how to correctly use the digital and analog gain?
Please prompt me, how correctly to write the next script?
We are using the niFgen Allocate Named Waveform VI for allocate three Waveforms. When you run Generator, working first Waveforms. Next, the Generator is switched and used in the following only second and third Waveforms.
Whether it is possible to realize?
I'm sorry, but the example is not completed yet.
Thank you.
Regards,
Engineer and software developer,
TeSLa.
10-30-2012 05:55 PM
Hi Max,
I would urge you to create a new forum post for this since this is a new issue, and mark one of the posts here as the correct answer to your original question - how to shift phase on the fly. This way we can maintain valuable and useful information on our forums for our users that is easily searchable.
Regards,
11-19-2012 02:16 PM
Hi,
A Matter of Principle.
Can be considered a signal change on-the-fly, as between two arbitrary waveform there is a wait in the 8 samples?
Thanks!
Max O.
Engineer and software developer,
TeSLa.
11-19-2012 05:33 PM
Hi Max,
I'm afraid I don't understand your question. Is this related to the questions you had about wait in this thread?
Script to random switch between different waveforms
Regards,
11-20-2012 01:10 AM
Hi Chris,
Yes, this is directly related with Script to random switch between different waveforms.
Max O.
Engineer and software developer,
TeSLa.