Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to run code

Solved!
Go to solution

I have just purchased a USB 6501. At this point I am unable to run a number of  the code examples that came with the latest NIDAQ902-1 package. 

 

In particular I am unable to run in VB the code "ContWriteDigChan_PipeSampClk". I am running;

 

 

Microsoft Visual Studio 2008
Version 9.0.21022.8 RTM
Microsoft .NET Framework
Version 3.5

Installed Edition: Professional

Microsoft Visual Basic 2008   91605-031-5000002-60668

On loading the code it runs the "Upgrade wizard", which perhaps is the root of the problem. It appears to be upgrading form Net1.0 to Net3.0.

When I run the code I get an exception error when the code comes to the line of code;

 

 

myTask.Timing.ConfigurePipelinedSampleClock("", CType(samplesClockRateNumericUpDown.Value, Double), SampleClockActiveEdge.Rising, _
                                     SampleQuantityMode.ContinuousSamples, CType(samplesPerBufferNumericUpDown.Value, Integer))

 

where myTask=>Assembly NationalInstruments.DAQmx

 

The exception error I receive is;

 

Requested value is not a supported value for this property.  Property: NationalInstruments.DAQmx.Timing.SampleTimingType You Have Requested: NationalInstruments.DAQmx.SampleTimingType.PipelinedSampleClock You Can Select: NationalInstruments.DAQmx.SampleTimingType.OnDemand  Task Name: _unnamedTask<0>  Status Code: -200077

 

I have tried unsuccessfully to remedy the situation by following the instructions above. Have you any advice on how to fix this problem?

 

 

0 Kudos
Message 1 of 9
(4,373 Views)

So what is the new error when you change to OnDemand timing?

0 Kudos
Message 2 of 9
(4,370 Views)

When I type in the following;

NationalInstruments.DAQmx.SampleTimingType.OnDemand()

 

The following coding error occurs; "Expression is not a method"

0 Kudos
Message 3 of 9
(4,367 Views)

I don't think that's the correct syntax but I can't quickly find the .NET examples on my pc.

0 Kudos
Message 4 of 9
(4,361 Views)

Is there anybody that you know at NI that has written more recent code that uses the

SampleTimingType.OnDemand method?

 

0 Kudos
Message 5 of 9
(4,357 Views)

If the requested value is not supported, make sure that you are not trying to sample faster than what your device can do. Also make sure that you are sampling at voltage levels supported by your device. Besides this, make sure that you are following correct naming conventions for your DAQmx tasks, such as not using an underscore character in front of your task name.

Regards,
Efrain G.
National Instruments
Visit http://www.ni.com/gettingstarted/ for step-by-step help in setting up your system.
0 Kudos
Message 6 of 9
(4,320 Views)

Thnaks this seems to  be the problem; the call is not supported by the product that I have.....

I am using a NI 6501 USB.

If I use either of the following write statements to the 6501, it is taking approximately 1.4mS to complete to write statement. 

WriteSingleSampleMultiLine or WriteSingleSampleSingleLine

The clock frequency of the computer that I am using is 3.6MHz. Thus in order to write one “bit” it is taking about 4mS. I have complied the program and run it separately and this does not significantly increase the speed of the operation.

Is this the sort of speed that I should expect from this product? Is there another “write” statement that I can use, in order to speed up the process?

0 Kudos
Message 7 of 9
(4,269 Views)

There is no other "write" function that you can use to speed the process. Have you made sure that your computer is not running out of RAM?

Regards,
Efrain G.
National Instruments
Visit http://www.ni.com/gettingstarted/ for step-by-step help in setting up your system.
0 Kudos
Message 8 of 9
(4,251 Views)
Solution
Accepted by topic author ShortShift

Not sure where you are getting the 4ms number. The time to do a write (~1.4 ms) is how long it takes to write a bit and is in line with these benchmarks.

0 Kudos
Message 9 of 9
(4,248 Views)