My goal is supplying a DC voltage (using PXIe-4138) to my setup and measure the current (drained from the source) vs time while I am sending analog control bits (using PXIe-6739) to an analog mux in my hardware.
I am using MATLAB 2017b (Data Acquisition Toolbox) and ok with sending desired outputs using PXIe-6739. However, I couldn't find a resource for controlling PXIe-4138 while sending data with PXIe-6739.
using MATLAB. When I use daq.getDevices, I don't see PXIe-4138 ( I guess this is expected since it's not a DAQ).
Looking for suggestions and code examples for controlling 4138 and 6739 together.
My hardware: PXIe-1078 chasis with two PXIe-6738s, PXIe-6739 and PXIe-4138.
Thanks a lot,
I don't think there is the specific example. Combining following example is good way.
Do you have a concern about Synchronization? See this article.
I am using these two examples but have two questions.
1- Measure current for few seconds requires multiple current measurements.
measurementType = 0; (instead of =1) makes it a current measurement, but it measures single data point. I would like to take many measurements during this time period, so I need to change measure_record_length somehow.
measure = get(ictObj, 'measure'); % this measure object has Measure_Record_Length but I couldn't change it
I guess invoke(measure,'???', desired_length) should solve the problem but couldn't find the list of commands to change this parameter.
2- I need synchronization and planning to use signal based sync. Are there any MATLAB example codes ? All the links are for LabView. I am guessing it will just take few lines of code in Matlab.
Thanks a lot !!!
1. What are the results you are getting?
2.There are some informaitona bout syncronization on MATLAB
1- I couldn't get a continuous measurement yet. I set the source mode to sequence but it doesn't work and couldn't find an example code.
Any help appreciated.
The error message that I am getting:
"The instrument returned an error while executing the function.
A sequence must have at least one step."
% driversInfo = instrhwinfo ('ivi');
ictObj = icdevice('nidcpower.mdd', 'DAQ:XI1Slot5');
channel = '0';
% Configure the Source mode to Sequence ( 1020 for Single Point)
sourceMode = 1021;
invoke(src, 'configuresourcemode', sourceMode);
% Set the output function to DC Voltage
outputFunction = 1006;
invoke(src, 'configureoutputfunction', channel, outputFunction);
srcDCVoltage = get(ictObj, 'sourcedcvoltage');
% Configure the Voltage level, in volts, for the output channel generation
voltageLevel = 1.2;
invoke(srcDCVoltage, 'configurevoltagelevel', channel, voltageLevel);
% Initiate the device to start generation
control = get(ictObj, 'control');
measure = get(ictObj, 'measure');
% invoke(measure, 'configuremeasurerecordlength', channel, 82);
% Measure current
measurementType = 0;
amps = invoke(measure, 'measure', channel, measurementType);
Can you share exactly what you are doing, and what errors, or messages are you receving? With this I can check if I can duplicate the behaviour.