Jump to content
Sign in to follow this  
thieumat

cFP DI frequency

Recommended Posts

Hi everybody!

I have a cFP DI that reads a pseudo-periodic pulse

how could I put this signal on a timeline to measure the length of the 1 pulse ?

I've tried to put it on a digital waveform but it seems to need an array of 8 signals, I don't realy understand

Any others methods are welcome

I have lavbiew 8.2 dev suite

Regards

matthieu

Share this post


Link to post
Share on other sites

How fast is this pulse? I seem to remember that the cFP poll cycle of its I/O module is relatively slow (I think it was a few ms), so if you have a faster pulse you might have a problem.

As for measuring the length, all you need is an FP Read VI which will output a single boolean and a loop with two shift registers - one to remember the previous value of the DI and one to remember the last time of the change. When you detect that the input changed (by comparing it to the previous value), you use the Tick Count primitive to get the current time and substract from it the previous time to get the number of ms that passed and that's your pulse length.

You might get higher accuracy with a timed loop, but I'm not sure if it's supported on the cFP.

Share this post


Link to post
Share on other sites

QUOTE(Yen @ Nov 29 2007, 12:26 PM)

...

You might get higher accuracy with a timed loop, but I'm not sure if it's supported on the cFP.

Yes it is supported but it is not any faster.

For fast signals I have used a counter timer module to measure the period.

It also sounds like the original questioner, is reading from all of the DI lines and not just one. If this is the case, either change the code to read only the single DI line or use an index array to pull out the channel of interest and then follow Yair advice.

Ben

Share this post


Link to post
Share on other sites

my frequency is about 100-300Hz so it won't be a problem for the sampling rate of the digital input (1kHz)

thank your for your help, it was very helpfull

matthieu

Share this post


Link to post
Share on other sites

another little question ;p

suppose that the frequency of my pulse is knowed, said 1Hz, easy to count

in MAX I can see it easealy on the specified channel of my cFP DI : 1 ... 0 ... 1 ... with the good frequency

but when I put a fp read and a indicator in a simple while loop the frequency is shorter and realy instable, sometimes 10Hz, sometimes 200Hz ...

I've tried with a delay between eatch loop, in a timed structure ... always the same

but in MAX it's still good !

is there is a diffrence between MAX reading and the fp read ?

Share this post


Link to post
Share on other sites

If the pulse is a stable 1 Hz and your TCP connection is consistent, then I see no reason why you shouldn't see the same thing in LabVIEW as you do in MAX. I suggest you upload the VI you're using to do this.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.