Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Sample Clock and Correlated Analog / Digital

Hi,

I've been trying to get this working for a while now, and I'm stuck.  I would greatly appreciate anyone's help.

I am trying to do the following.  I have a unit under test that outputs (1) a strobe signal, (2) two analog signals, and (3) 16 digital signals.  I've hooked this up to a NI card, with the strobe signal on PFI9, the two analog signals on ai1 and ai0, and the digital signals on /dev1/port1/line7:0 and /dev1/port0/line7:0.  I want to take one sample of all of the signals upon each rising edge on the strobe signal.  I want those samples, either one by one or a batch of them, to be sent to a callback.

So, having looked at the samples and the docs, I've come up with this snippet of code (below).  But, it never gets past the verify..  It reports the error:
 Requested value is not a supported value for this property

 Property: NationalInstruments.DAQmx.Timing.SampleTimingType
 Requested Value: NationalInstruments.DAQmx.SampleTimingType.SampleClock

 Task Name: diTask

 Status Code: -200077


Code:
                    //Create a new Task
                    myAnalogTask = new Task("aiTask");
                    myDigTask = new Task("diTask");
           
                    //Create a new virtual channel for analog input
                    myAnalogTask.AIChannels.CreateVoltageChannel("/Dev1/ai1:0", "",
                        AITerminalConfiguration.Rse,
                        0.0,
                        3.5,
                        AIVoltageUnits.Volts);
                    myDigTask.DIChannels.CreateChannel("/Dev1/Port2/Line0,/Dev1/Port1/Line7:0,/Dev1/Port0/Line7:0", "", ChannelLineGrouping.OneChannelForAllLines);

                    // Create a new virtual channel for digital input                     myAnalogTask.Timing.ConfigureSampleClock("/Dev1/PFI9",750.0e3,SampleClockActiveEdge.Rising,SampleQuantityMode.ContinuousSamples);
                    myDigTask.Timing.ConfigureSampleClock("/Dev1/PFI9",   750.0e3,SampleClockActiveEdge.Rising,SampleQuantityMode.ContinuousSamples);
                    /*
                    myDigTask.Timing.ConfigureChangeDetection(
                        "/Dev1/Port2/Line0", "", SampleQuantityMode.ContinuousSamples);
                    */
                    
                    //Verify the Tasks
                    myAnalogTask.Control(TaskAction.Verify);
                    myDigTask.Control(TaskAction.Verify);


                    //Create a new Task
                    myAnalogTask = new Task("aiTask");
                    myDigTask = new Task("diTask");
           
                    //Create a new virtual channel for analog input
                    myAnalogTask.AIChannels.CreateVoltageChannel("/Dev1/ai1:0", "",
                        AITerminalConfiguration.Rse,
                        0.0,
                        3.5,
                        AIVoltageUnits.Volts);
                    myDigTask.DIChannels.CreateChannel("/Dev1/Port2/Line0,/Dev1/Port1/Line7:0,/Dev1/Port0/Line7:0", "", ChannelLineGrouping.OneChannelForAllLines);

                    myAnalogTask.Timing.ConfigureSampleClock("/Dev1/PFI9",750.0e3,SampleClockActiveEdge.Rising,SampleQuantityMode.ContinuousSamples);
                    myDigTask.Timing.ConfigureSampleClock("/Dev1/PFI9",   750.0e3,SampleClockActiveEdge.Rising,SampleQuantityMode.ContinuousSamples);
                   
                    //Verify the Tasks
                    myAnalogTask.Control(TaskAction.Verify);
                    myDigTask.Control(TaskAction.Verify);

0 Kudos
Message 1 of 5
(3,476 Views)
Hey foobar1111111111,

Thanks for contacting National Instruments support.  The reason that you are getting this error is because you are trying to use a clock on a port other than port 0.  Our M Series devices support correlated Digital, but only on port 0.

Some of our M Series devices have a 32  line port 0, and that would work for you application, but using port 1 in your task is giving you this error.  Our E Series devices do not support correlated Digital at all so if you are using an E series card than it also give you an error.  You could supply the clock to one of our digital boards as well as the MIO board you are using, but that may require that you purchase the card.

Let me know if you have further questions.

Regards,

Message Edited by Kenn N on 07-06-2007 09:55 AM

Kenn North
Principal Product Manager - Search, Digital Analytics
http://ni.com/search
0 Kudos
Message 2 of 5
(3,458 Views)
Kenn,

Thanks for your response.

Perhaps I am confused about ports...  I am using an M-series board (PCI 6221, 68pin)

I got these port numbers from a pinout diagram, and saw that there were pins labeled P0.0, P0.1 ... P0.7, and P1.0, P1.1, ... P1.7.  I assumed that P0.* was port zero, and P1.* was port one, etc.

So, does this mean that I simply cannot capture this many signals upon rising edge?

Thanks,
Nick

0 Kudos
Message 3 of 5
(3,451 Views)
Hey foobar,

Yes, you are correct on both accounts, the 6221 has an 8 bit Port 0, labeled P0.0...P0.7 and these are the only lines that can acquire data on the rising edge of a clock.  Let me know if you have further questions.

Regards,
Kenn North
Principal Product Manager - Search, Digital Analytics
http://ni.com/search
0 Kudos
Message 4 of 5
(3,447 Views)
Kenn,

Again, thank you.  I guess I'll have to figure something else out.

Nick
0 Kudos
Message 5 of 5
(3,444 Views)