04-06-2015 04:33 PM
Hi every one,
im using the NI switch 2510 (68 channel bus A and B are connected respectively to DMM '4072' HI and DMM LO). to access this hardware, i use API driver provided for the .NET class DMM and SWITCH .
so far, i succeed doing DMM/Switch combination to get correct mesurement, everything goes as excpected.
now i have a list of pins that need to be tested (open test and short test for a long list of pins), i plane using the Resistance Mesurement 2 wire to get the open/Short test done,
procedure followed :
and i repeat this for the rest of the 120 Pins
probem is that this procedur took several seconds about (10 second for 120 pins);my question is : is there any other methode that i can use instead of doing so ?
i have read in diffferent thread that i can use Fetch instead of mesure in the DMM class, but after doing so, nothing changed in terme of timing !!! 10 second remain 10 second !!
waiting for your help
Best Regards
04-07-2015 04:13 AM
here is the code used :
Resistance Mesurement :
using NationalInstruments.ModularInstruments.NIDmm;
using NationalInstruments.ModularInstruments.SystemServices.DeviceServices;
public double PerformResistanceMeasurement2W(string sResourceName, double dRange, double dResolution, double dPowerLineFrequency)
{
double reading = 0.0;
//dRange = 100.0;
//dResolution = 3.5;
//dPowerLineFrequency = 60.0;
try
{
// Create a Dmm Session
niDmmSession = new NIDmm(sResourceName, false, false);
//Get the Measurement Mode
DmmMeasurementFunction measurementMode = DmmMeasurementFunction.TwoWireResistance;
//Configure Dmm session Measurement parameters
niDmmSession.ConfigureMeasurementDigits(measurementMode, dRange, dResolution);
niDmmSession.Advanced.PowerlineFrequency = dPowerLineFrequency;
//Initaite the mesurement
niDmmSession.Measurement.Initiate();
// Obtain the reading
reading = niDmmSession.Measurement.Fetch();
if (niDmmSession != null)
niDmmSession.Close();
return reading;
}
catch (Exception)
{
if (niDmmSession != null)
niDmmSession.Close();
return reading;
}
}
Closing the switch to Hi or Low:
public Boolean ClosePinH_NIsw(string sDeviceAddress, string sSwitchTopology, string sRelayName)
{
try
{
CloseSession();
Initialize_NIsw(sDeviceAddress, sSwitchTopology);
switchSession.RelayOperations.RelayControl(sRelayName + "a", SwitchRelayAction.CloseRelay);
// Wait for the relay to activate and debounce.
switchSession.Path.WaitForDebounce(maximumTime);
//Close session to switch module.
CloseSession();
return true;
}
catch (Exception)
{
//Close session to switch module.
CloseSession();
return false;
}
}
private string CloseSession()
{
if (switchSession != null)
{
try
{
switchSession.Close();
switchSession = null;
return "0";
}
catch (System.Exception ex)
{
return "Unable to Close Session, Reset the device.\n" + "Error : " + ex.Message;
}
}
return "0";
}
and to perform open/Short test i use this function :
public Boolean TestIndependentOpenNet(List<string> _openNetList,int iNumRepetition,double dUpper,double dLower,string sMesurementUnit)
{
bool bResult = false;
string sPrincipalPin, sSecondaryPin;
double dMesurement = 0.0;
try
{
sPrincipalPin = _openNetList.First();
//Close to high first pin in open Net list
_SignalControl.ClosePinHigh(_openNetList.First());
for (int i = 1; i < _openNetList.Count; i++)
{
//Close pin to low DMM
_SignalControl.ClosePinLow(_openNetList[i]);
//Read Value from DMM
for (int y = 0; y < iNumRepetition; y++)
{
dMesurement = _MyDMM.PerformResistanceMeasurement2W(DmmVisaAleas, 100, 3.5, 60);
//check values
if (dMesurement < dUpper && dMesurement > dLower)
{
//if result is Ok, open pin and go out
_SignalControl.OpenPinLow(_openNetList[i]);
//write tracability to .txt file
iniManager.WriteLine(sTraceFilePath, sPrincipalPin + ":::" + _openNetList[i], Math.Round(dMesurement, 3).ToString() + sMesurementUnit, true);
bResult = true;
break;
}
else
{
sSecondaryPin = _openNetList[i];
Thread.Sleep(10);
bResult = false;
}
}
if (!bResult)
{
_SignalControl.OpenPinLow(_openNetList[i]);
//write tracability to .txt file
iniManager.WriteLine(sTraceFilePath, sPrincipalPin + ":::" + _openNetList[i], Math.Round(dMesurement, 3).ToString() + sMesurementUnit, false);
break;
}
}
//Open first pin in the open Net
_SignalControl.OpenPinHigh(sPrincipalPin);
return bResult;
}
catch (Exception _ex)
{
MessageBox.Show("independent open Net \n" + _ex.ToString(), "Error Hundler", MessageBoxButton.OK, MessageBoxImage.Error);
return false;
}
}
thats all what i have reached , test time is about 10 second for 100 pins, is there a way to decrease this test time please ?
04-07-2015 07:42 PM
I don’t see an obvious reason for the long time you are experiencing, however I do have a few questions.
Are you basing your program in a sipping or community example? If so I would actually like to know which one to give it a look.
Repeatedly opening and closing the references s not quite efficient. When you tried with the Fetch method; did you also do that? Did you consider or try using hardware handshaking as well?
Finally, I would like to know what your expectations about the switching rates are.
04-08-2015 02:55 AM
Hi Camilo,
thanks for your time
about the code , i have write it based on the examples provided when installing Ni switch .net class here and Ni DMM .net class library here
i have attched the 2 .dll that i have created to control switch/DMM, (can you please take a look at it)
i did not do any hardware handshaking? as i do not have any idea what that means ? could you explain that please with some exampoles ?
for the time expectation, i belive that i can reach 1s for 100 pins instead of 10s !!
Best Regards.
04-08-2015 04:05 AM
i have done some experiement this morning and found that to do a simple resistance mesurement it takes about 0.7 s
here is steps followed :
Close Pin to HI + LOW DMM = 438 ms
do the mesurement by DMM = 148 ms
open PIN HI + LOW = 74 ms
total time = 660 ms, this is really big time cosuming ??
im i missing something or doing something wrong ?
many thanks for your help.
04-08-2015 11:29 AM
I see a lot of inefficiencies in how the NI 4072 is being programmed. My advice is to open the session to the device only once, and configure only once. use multi-point measurements and trigger with a software trigger to perform each measurement. Take a look at the examples for how to do this.
04-08-2015 11:29 AM
I see a lot of inefficiencies in how the NI 4072 is being programmed. My advice is to open the session to the device only once, and configure only once. use multi-point measurements and trigger with a software trigger to perform each measurement. Take a look at the examples for how to do this.
04-08-2015 11:49 AM
Hi Marcos,
could you please attach/post some examples here ?
many thanks
04-08-2015 06:38 PM
Hello,
The NI-DMM and NI-Switch are in the following directories (or equivalent).
NI-DMM: C:\Users\Public\Documents\National Instruments\NI-DMM\examples
NI-Switch: C:\Users\Public\Documents\National Instruments\CVI\Samples\niSwitch
Among the DMM examples, there are several for multipoint and if you open the CVI subdirectory you will find some more. In the NI-Switch examples directory you should find an niSwitchDMMSwitchHandshaking example that might be useful. Using a multipoint acquisition should be enough to decrease you acquisition times though.
04-09-2015 11:08 AM
Hi BadreArras,
If you have the NI-DMM .NET Class Libraries installed, there should be examples installed on your system. One example in particular shows how to program a software triggered acquisition.
To find the example programs, navigate to Start » All Programs » National Instruments » NI-DMM » Examples » .NET 4.0 Languages Support » SoftwareTriggeredMultipointAcquisition » cs
This program is set up to return 10 measurements whenever the "sampleDmmSession.Measurement.SendSoftwareTrigger();" call is made. If you set the Number of Measurements to 1, you should be able to take one measurement whenever the software trigger is asserted. Using this method instead of reinitializing and reconfiguring the DMM for every measurement should speed things up significantly.