Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

PXI 6541 asynchronous strobe trouble

I'm using a 6541. I would like to collect data based on a strobe edge. The strobe is not a continuous frequency. I'm using the function

 

       niHSDIO_ConfigureSampleClock(acqVi, NIHSDIO_VAL_STROBE_STR, sampleClockRate) to configure the acqisition session to collect data when the strobe line is strobed. I'm assuming that the sampleClockRate is ignored. At least I want it to be ignored since I want the card to wait indefinately or at least within a timeout period until the strobe is received.

 

   When I call    niHSDIO_Initiate (acqVi); is receive the following error:

 

       0:DAQmx Error -200586 occurred:
Measurements: Hardware clocking error occurred.
       If you are using an external sample clock, make sure it is connected and within specifications. 
       If you are generating your sample clock internally, please contact National Ins

 

   This error returns bfore I have the opportunity to call niHSDIO_Initiate (genVi) to generate the strobe. Can anyone please help?



 

0 Kudos
Message 1 of 16
(4,337 Views)

Hi Steve,

 

The 6541 is not intended to run with a non-free-running clock, which is why you are seeing hardware clocking errors.

 

What are the specs on your "data valid" signal - the one you're currently connecting to Strobe?  How long is the pulse with respect to your incoming valid data?

 

You could try using the onboard clock for your acquisition and use your current "Strobe" signal as a pause trigger.

 

What's the source of the data?  Is it from logic?  Or is it the output of a flip-flop?

 

Thanks,

Keith Shapiro

National Instruments R&D

0 Kudos
Message 2 of 16
(4,335 Views)

Steve,

 

The 6541 has a restriction that the clock must be continuously running when the task is commited through when it is closed.  At what frequency are you running?  Can you describe the application so we can see if ther are options available?

0 Kudos
Message 3 of 16
(4,334 Views)
I need data to be recorded when and only when the strobe is received. Is the card not capable of doing this?
0 Kudos
Message 4 of 16
(4,332 Views)

The 6541 can indeed receive samples when an associated signal is active, however the sampling clock on the 6541 must be free running.  You can use the 6541's onboard sampling clock and use your strobe trigger to indicate data is valid.

 

If you're looking for purely asynchronous sampling, the 6541 cannot do it, due to its high-speed pipelined architecture.

 

That said, with some more information about your application, I believe it's possible to use the 6541 either in the way I describe above, or by using single-sample multi-record acquisitions to acquire based on the rising edge of your strobe signal.

 

If you can give us some more details of your application (like a timing diagram with the strobe to data relationship and pulse widths) we could help find you an optimal solution.

 

Keith Shapiro

National Instruments R&D

0 Kudos
Message 5 of 16
(4,322 Views)

Hey Steve,

 

As Keith and Ryan mentioned, we can help you get this working with your current hardware. But I also wanted to mention that there are other high speed digital boards that have the asynchronous sampling mode, which will work with a non-free running clocks that you have. If you are willing to explore this other option, here is some info that might help. First I am referring to the NI PXIe-6535 (10 MHz), 6536 (25 MHz), and 6537 (50 MHz) devices. If you are interested in these devices that you can supply your non free running clock to in order to sample whenever there is a rising edge (or falling), then the great thing is is that the cabling and accessories for your 6541 are the same for the 6535/6/7's. Another thing you'll have to consider is that these boards are PCIe and PXIe Express format, so you would need a hybrid PXIe slot on your chassis, or an empty PCIe slot on your PC depending on your application. Another consideration is that with the 6535/6/7 devices, you would program them with the DAQmx API, not the HSDIO functions. Also, these 6535/6/7 devices have the ability to use a free running clock in the Pipelined Sample Clock mode in DAQmx (which is similar to the HSDIO Sample Clock mode), or it can run with a non free running clock using the DAQmx Sample Clock mode.

 

If you absolutely need PXI, then there might be another option, depending on how fast your clock might go, but I'll hold off on that hardware until we know more about what your specs are.

 

Again, we can help you with your existing 6541, but depending on your application needs, there might be other hardware that will work for you. I am just trying to let you know of other available options, not telling you that you should choose one over the other at this point. Please let us know more about your application, and we'll hopefully get you up and running. Thanks, and have a great day.

 

Regards,

DJ L.

0 Kudos
Message 6 of 16
(4,311 Views)

I was able to use the pause trigger to collect the samples that I need, however, the buffer size is variable and the functions  niHSDIO_WaitUntilDone and niHSDIO_FetchWaveformU32 error out if the number of samples specified by niHSDIO_ConfigureAcquisitionSize are not received. How can I determine how many samples have been received and only read the ones that have been received? I tried niHSDIO_SetAttributeViInt32 to get attributes for NIHSDIO_ATTR_REPEAT_MODE and NIHSDIO_ATTR_REPEAT_COUNT but only get 0s if not all samples have been read and a 1 for  NIHSDIO_ATTR_REPEAT_COUNT if all the samples have been received.

 

 

0 Kudos
Message 7 of 16
(4,307 Views)

Hi Steve -

 

Glad to hear you're having success so far with the pause trigger.  Do you have any signal that's coming from your device to the 6541 that can signal the end of your waveform?  Or, when your capture is complete, can you program your device to make strobe active?

 

If you can do the latter, you can set your record size to some maximum number and it will just complete automatically (filling your buffer with whatever is left on the pins), then you can fetch and discard the extra data.

 

Keith Shapiro

National Instruments R&D

0 Kudos
Message 8 of 16
(4,305 Views)

Steve,  you can use a combination of the Fetch Backlog and Fetch relative to properties.

 

Copied from the help file....

 

Dynamic Acquisition:Fetch:Fetch Backlog Property

Short Name: FetchBacklog

Property of niHSDIO

Queries how many acquired data points remain in onboard memory.

This property is valid only for acquisition sessions.

This property is used with the Fetch Offset and Fetch Relative To properties. This property returns the number of samples available from the given Fetch Relative To and Fetch Offset.

 

 

Message Edited by Ryan M on 09-17-2009 02:10 PM
0 Kudos
Message 9 of 16
(4,299 Views)
The Fetch Backlog is giving me zero even though there is data in the buffer.
0 Kudos
Message 10 of 16
(4,296 Views)