From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

reading clock polarity

Hello, I am using LV to produce a user adjustable clock from a PCI-6031E card. I use an event structure from an external trigger to start acquisition in a separate thread and need to know the clock polarity within the acquisition loop. I cannot come up with an elegant way to do this. The best strategy has been to wire the clock output to a digital input and read. Anybody know of a better way?

 

Thanks

0 Kudos
Message 1 of 4
(2,781 Views)
Reniam,

It depends what attibute of the clock that you need. So if you absolutely need the acquistion clocks high or low state, then the only thing you can do to read it is, get it to where you can route it externally (say to PFI 0) then then externally feed this line back into a digital like, as you mentioned. Now, if you were needed it just as another clocking source, or need the frequency/period of the clock then you could just route it to a PFI line, and use the line for what ever measurement (e.g. counter measurement) you need provided that it is not actually reading the state of the line. But if you absolutely need the state (e.g. high or low), then externally routing is the only way to go. Let us know if you have any other questions, or need clarification on any of that.

-GDE
0 Kudos
Message 2 of 4
(2,765 Views)

GDE,

Thank you for your input. Yes, I just need to know the level of the clock so I suppose wiring to an input is the only way. It seems really goofy that a read cannot be done on an output. I can do this with any $2 microcontroller.

0 Kudos
Message 3 of 4
(2,759 Views)
Reniam,

One last thing, where is the clock being generated. Is it external to the DAQ board? This is what I had though originally, but if the DAQ board is creating the clocking signal on the digital output, then you can definitely just read in the value without having to externally do a loopback. If this is the case all you have to do, is after the DAQmx Digital Write call, make a call to the DAQmx Digital Read and you can read the state of the output. I have included a screen shot of how to do that in LabVIEW. Let me know if that is what you were looking for, sorry about the confusion if so. Otherwise if the clock signal is generated completely external to the DAQ card then you would have to externally read it in somehow.

-GDE
0 Kudos
Message 4 of 4
(2,743 Views)