PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

PXI-6624: How to use different terminals for TwoEdgeSeperationMeasurement?

Hello,

i wrote a .NET application to control my PXI-6624 Timer/Counter-Module. On counter0 i generate an output frequency on the OUT terminal (PFI36). Now i want to measure i.e. with channel 4 (CTR4) the pulse width of the generated frequency. Therefore i create a task and assign a channel to it. Then i change the default terminals for the start and stop trigger (PFI21 and PFI22 at CTR4) to the counter0 output terminal (PFI36) and try to start the measurement.

Here is my code in .NET/ C#:

 

objTaskCI = new Task();

CITwoEdgeSeparationFirstEdge edgeStart = CITwoEdgeSeparationFirstEdge.Rising;

CITwoEdgeSeparationSecondEdge edgeStop = CITwoEdgeSeparationSecondEdge.Falling;

objTaskCI.CIChannels.CreateTwoEdgeSeparationChannel("PXI1Slot6/ctr4", "test", dMinValue, dMaxValue, edgeStart, edgeStop, CITwoEdgeSeparationUnits.Seconds);

objTaskCI.Control(TaskAction.Verify);

objTaskCI.CIChannels.All.TwoEdgeSeparationFirstTerminal = "PXI1Slot6/ctr4/PFI36";

objTaskCI.CIChannels.All.TwoEdgeSeparationSecondTerminal = "PXI1Slot6/ctr4/PFI36";

objTaskCI.Timing.ConfigureImplicit(SampleQuantityMode.FiniteSamples, 1000);

CounterReader objReaderEdge = new CounterReader(objTaskCI.Stream);

double[] data = objReaderEdge.ReadMultiSampleDouble(iSamples);

 

When i try to measure i get an exception with the following error: "Specified route cannot be satisfied, because the hardware does not support it..."

 

When i externally link the output signal of counter0 to an input terminal of counter0 (i.e. PFI39) by conneting a wire and then start the measurement with PFI39 as Terminal, i don't get the above exception. Instead i get a timeout-exception ("Some or all of the samples requested have not yet been aquired..."). Looks like that the signal is internally not available.

 

When i create a task in MAX (Measurement Automation Explorer) for signal generation on counter0 and start the testpanel for the 6624 in counting-mode on channel4 with input from PFI36 (OUT terminal) i get the same error message like above (case1). Now i change the input from PFI36 to PFI39, which is still externally connected to the testsignal, the counter counts.

 

How can i do a Two-Edge-Seperation-Measurement in .NET/C# with start and stop trigger-terminals from other counter channels than the measure counter channel?

 

hope anyone can help...

0 Kudos
Message 1 of 3
(3,239 Views)
Has anyone an idea?
0 Kudos
Message 2 of 3
(3,188 Views)

Hi thesam,

 

I tested your .NET code and got the same error: -89120 ("Specified route cannot be satisfied, because the hardware does not support it...")

 

I took a closer look and found the problem.

Down here you cann see your modified code.

red: new code

green: your old code 

 

 

objTaskCI = new Task();

CITwoEdgeSeparationFirstEdge edgeStart = CITwoEdgeSeparationFirstEdge.Rising;

CITwoEdgeSeparationSecondEdge edgeStop = CITwoEdgeSeparationSecondEdge.Falling;

objTaskCI.CIChannels.CreateTwoEdgeSeparationChannel("PXI1Slot6/ctr4", "test", dMinValue, dMaxValue, edgeStart, edgeStop, CITwoEdgeSeparationUnits.Seconds);

objTaskCI.Control(TaskAction.Verify);

objTaskCI.CIChannels.All.TwoEdgeSeparationFirstTerminal = "/PXI1Slot6/PFIx";                          //  "PXI1Slot6/ctr4/PFI36";

objTaskCI.CIChannels.All.TwoEdgeSeparationSecondTerminal = "/PXI1Slot6/PFIx";                     //   "PXI1Slot6/ctr4/PFI36";

objTaskCI.Timing.ConfigureImplicit(SampleQuantityMode.FiniteSamples, 1000);

CounterReader objReaderEdge = new CounterReader(objTaskCI.Stream);

double[] data = objReaderEdge.ReadMultiSampleDouble(iSamples);

 

 

 

Best regards

Dippi

Message 3 of 3
(3,154 Views)