thieumat Posted November 30, 2007 Report Share Posted November 30, 2007 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 Quote Link to comment
Yair Posted November 30, 2007 Report Share Posted November 30, 2007 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. Quote Link to comment
LAVA 1.0 Content Posted November 30, 2007 Report Share Posted November 30, 2007 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 Quote Link to comment
thieumat Posted December 1, 2007 Author Report Share Posted December 1, 2007 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 Quote Link to comment
thieumat Posted December 4, 2007 Author Report Share Posted December 4, 2007 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 ? Quote Link to comment
Yair Posted December 5, 2007 Report Share Posted December 5, 2007 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. 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.