The DCPower API doesn't provide VIs to use Power Supplies or SMUs as FGENs. However it is possible to program the board to output standard functions by translating the desired frequency and amplitude to a continuous output sequence with source delays set so that the output function the user selects is output on the terminals of the device.
The attached program allows you to use a NI 414x, NI 4135/4136/4137/4138/4139 as an FGEN. As is, the program is limited to a maximum output frequency of 5 kHz.
I've attached a version of the code for outputting current waveforms and a version for outputting voltage waveforms.
ok, thank You very much.
Also no problem when PXIe chassis remotely controlled via PCIe card (without embedded controller in chassis)?
You should not see a difference in the VIs performance whether you are using an embedded controller or a remote controller via MXI connection.
I've implemented Signal Calculation.vi successfully in my program to generate continuous current waveforms.
Is there anyway to measure the output signal using the internal sensor? I've tried using the example under DCpower in NI-DCPower Measure Record.vi and do see a waveform however it's not the correct frequency. In fact, when I look at the power spectrum the frequency changes with aperture time.
This is using NI-PXIe 4141 with Fetch Multple Measurement VI. I've had to set When Measure to auto since "On Demand" can't be used. Do I need to set it to trigger and decouple measurement and source?
Can you clarify what your goal is? Do you want to take measurements while the SMU is outputting a function like a sine wave? The FGEN and Signal Calculation VI I provided above don't use the measurement engine of the SMU at all. You could add a few VIs to the code to get this functionality however.
To maximize the sampling rate you could set the Aperture Time property to 0 and the driver will coerce the value to the smallest valid aperture time for the hardware you're using (1.66 us for 414x devices - 555.5 ns for 4135/6/7/8/9). You could then set the Measure Record Length and the Measure Record Length is Finite? attributes to have the SMU sample continuously. You could then fetch measurements from the output continuously.
Sorry for the ambiguous goal.
That is exactly what we're trying to do. The system is completely isolated so we can't use external devices to measure the signal. The only option is to use the internal sensor of the 4141.
The maximum current output is 100 uA so we can't set the aperture time to the min number as there's too much noise to see the signal. With that, we set the aperture time dynamically while the VI is running. The higher the frequency of the signal, the lower we set the aperture time. This works quite well.
I am assuming we set the "Measure Record Length is Finite" -> True? Otherwise, if it's false then the "Measure When" needs to be set to "On Trigger".
Trying the mentioned solution, I still see the signal however increasing the Measure Record Length simply "zooms" in and decreases the frequency on the power spectrum. Increasing the aperture time also decreases the frequency on the power spectrum.
I attached a ss of a part of the VI handling the measuring process.
If you're seeing the frequency decrease in your power spectrum it is probably because the measurements are being taken during the sequence output. If at every individual output setpoint in the sine wave you wait and take a measurement before the output moves on onto the next setpoint in the array, the frequency of the output signal will decrease.
You can completely decouple the sampling from the output sequencing engine so that it takes measurements without affecting the frequency of the output function. Try setting the Measure When property to On Measure Trigger. Then set Measure Record Length to how many samples you would like to capture of the waveform. If you would like to sample continuously, you can set Measure Record Length is Finite to False. Then use niDCPower Configure Trigger to set the Measure Trigger to Software Edge. If you do all of this, you can call niDCPower Send Software Edge Trigger after you've initiated and the device will read the number of samples you've requested into memory. You will need to call niDCPower Fetch Multiple to retrieve the samples.
Let me know if you have any question or issues with this implementation.
Thanks for the suggestions.
Implemented them and everything works perfectly.
I attached a snippet of the subVI I use to initialize the whole setup for reference. I have to resend the SW trigger every time I stop and initilize.
Looks like I spoke too soon.
Do you know what the cause of this error could be?
niDCPower Fetch Multiple.vi<ERR>Onboard device memory underflow. Because of system and/or bus-bandwidth limitations, the driver could not write data to the device fast enough to keep up with the device output rate.
This showed up when I was changing the frequency on one channel. I solved it by first initializing the sequence by 1 mHz in the above post. Now this error shows up when I activate more than one channel. I was able to activate all channels fine before when "Measure When" was set to "Automatically".