georgekm Posted June 12, 2008 Report Share Posted June 12, 2008 Hello, I am trying to get the frequency of a digital signal. I used the DAQAssistant to collect N samples off a digital line. The outpiut data format is a 1 D array of digital waveform. I cannot connect it to the Signal processing VI since it needs to be in the 'Dynamic data' format. Using the 'Convert to dynamic' Vi does not work either. How do you process a digital signal? Thx. Quote Link to comment
Neville D Posted June 12, 2008 Report Share Posted June 12, 2008 What hardware are you using? what is the frequency of interest? Show us your code. I would use a counter channel to measure frequency. Look at examples for counters. Neville. Quote Link to comment
georgekm Posted June 13, 2008 Author Report Share Posted June 13, 2008 Hello, I'm using a PCI 6221 DAQ Card. I am reading in an encoder signal through one of the digital inputs (PF1). The output is a 1 D arrray of digital waveform and the Signal processing VI won't take it in as an input. Code is attached. Thanks! George QUOTE (Neville D @ Jun 11 2008, 01:12 PM) What hardware are you using? what is the frequency of interest? Show us your code.I would use a counter channel to measure frequency. Look at examples for counters. Neville. Quote Link to comment
Neville D Posted June 13, 2008 Report Share Posted June 13, 2008 QUOTE (georgekm @ Jun 12 2008, 10:17 AM) Hello,I'm using a PCI 6221 DAQ Card. I am reading in an encoder signal through one of the digital inputs (PF1). The output is a 1 D array of digital waveform and the Signal processing VI won't take it in as an input. Code is attached. Thanks! George Apart from a very snazzy icon, you seem to have done little else! Like I said before use a counter for measuring frequency, not a digital line. Look at the examples on counters in LV and search the NI website for "reading counters" or "reading encoders". There is some info there to clean up signals as well as using quadrature encoders. This is quite critical for a real-world application since, noise is very likely to corrupt your encoder signals, and using these techniques you will count the correct transitions of the encoder pulse (avoid reverse counts), and avoid missing pulses. As to your specific question: you can use an unbundle node on your digital waveform and that should give you: * the Y array of digital data * t0 the start pt * dt the time between successive pts. Then you can do whatever processing you want on the array; though I would imagine you just need to count the number of high values (N) and divide by (dt*N), so I don't really see the need for a "signal processing" VI..? Neville. Quote Link to comment
georgekm Posted June 17, 2008 Author Report Share Posted June 17, 2008 Cool thx! Lemme try what you say. I need to use the encoder signal as a trigger to collect data too. Hope that spossible with a counter. George QUOTE (Neville D @ Jun 12 2008, 03:10 PM) Apart from a very snazzy icon, you seem to have done little else! Like I said before use a counter for measuring frequency, not a digital line. Look at the examples on counters in LV and search the NI website for "reading counters" or "reading encoders". There is some info there to clean up signals as well as using quadrature encoders. This is quite critical for a real-world application since, noise is very likely to corrupt your encoder signals, and using these techniques you will count the correct transitions of the encoder pulse (avoid reverse counts), and avoid missing pulses. As to your specific question: you can use an unbundle node on your digital waveform and that should give you: * the Y array of digital data * t0 the start pt * dt the time between successive pts. Then you can do whatever processing you want on the array; though I would imagine you just need to count the number of high values (N) and divide by (dt*N), so I don't really see the need for a "signal processing" VI..? Neville. Quote Link to comment
georgekm Posted June 17, 2008 Author Report Share Posted June 17, 2008 QUOTE (georgekm @ Jun 16 2008, 08:44 AM) Cool thx!Lemme try what you say. I need to use the encoder signal as a trigger to collect data too. Hope thats possible with a counter. I tried unbunling the waveform output but am running into the same data type compatibility issues. Whats the deal with these waveform outputs? I can't seem to do anything with them... George Quote Link to comment
georgekm Posted June 17, 2008 Author Report Share Posted June 17, 2008 Cool! Using the counter input worked. Thx a ton. George QUOTE (georgekm @ Jun 16 2008, 08:44 AM) Cool thx!Lemme try what you say. I need to use the encoder signal as a trigger to collect data too. Hope that spossible with a counter. George Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.