LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

period and pulse sequence measurement

Hi All,
 
I need help with my research project. I am trying to measure the period or pulse sequence for each task (the output in miliseconds) for different output pin. The sequence of tasks maybe like ABBABAAAB. I was using 8051 port (port1.1 for task A and port 1.2 for task B) to create the pulse or period input to DAQ board, E series. I have used pulse or period measurement in example and save the time to txt file for analysis. I have tried change the port 1.2 to port 1.1 for Task B as to make only one port for both Task A and B. The problem is I did not get the output as expected. I mean the 'txt' output for time not like as sequence as given above.
 
To make clear, I give the example of the output what expecting.
 
Task sequence
 
ABBABAAAB.... for example pulse for A is 2 ms and B is 1.5 ms.
 
The Output as expected is
 
21.51.521.52221.5
 
 
So, could someone help me how to solve this.
 
Thank you
Nazri
0 Kudos
Message 1 of 4
(2,770 Views)

Hi Nazri,

Thanks for your post, sorry I'm still a bit unclear what you're trying to do.

Are you generating separate pulse trains on two outputs, then trying to measure them on one input? Are you trying to use digital output lines or counter outputs? Which lines are you using to measure the pulses, and how are you setting up the Data Acquisition?

Could you possibly post what code you are currently using to try this measurement, and exactly how your signals are connected?

Many thanks!

Mark

0 Kudos
Message 2 of 4
(2,744 Views)
Hi Mark,
 
Thanks for your reply.
 
1. Yes. There are two options of generating pulse train I am trying now
   i. Generating two different pulse train on two outputs(from my own board - here from 8051 microcontroller), and connect the output to PFI4 and PFI9 respectively. But the output txt file for both signals are in one txt file. My acquisition card is PCI-6035E. I made all the digital I/O as input.  This is what I am going to try in future.
 
   ii. Generating two different pulse train on one output, example task A and B using same output pin, and connect the output to PFI4 or PFI9. This is what I am trying right now.
 
2. As attached is my code. Measure pulse and measure period. Taken from example and made some changes on it.
 
3.  How signals was connected is:- 
 
In my code, in front panel, at gate specification,  I changed the PFI Line to PFI 4 and gate polarity. Others using default settings.
I have connected the output to connector pin number 41(PFI4) or 3(PFI9) in I/O connecter pinout(green one) and using connector pin number 7 and 36 as digital ground.
 
4. One question. What is the minimum and maximum pulse train time to ensure we can measure correctly in labview.
 
Thank a lot.
Rgds
Nazri.
 
  
 
 
 
Download All
0 Kudos
Message 3 of 4
(2,741 Views)

Hi Nazri,

Thanks for posting your counter code.

The minimum pulse width you can count using the counters is based upon what source clock you feed the counter, there is a KnowledgeBase about this calculation here:

http://zone.ni.com/devzone/conceptd.nsf/webmain/7C77FB9EDC17C3C386256802007B8AB3

Basically the closer your pulse width gets to the period of the source clock, the less accuracy you can give to the measurment.

The way I see it, if you had 2 separate pulse trains coming into LabVIEW, you could count the pulse widths on both, and then try and do some processing to write them into the same file. The other way you were suggesting is to combine both signals onto the same counter input line, and then just count the pulses in sequence. This sounds like a better way to do the count, but what happens if 2 pulses impinge on each other (happen at the same time)?

What are you currently getting in your text file?

There's a simpler example of reading pulse widths using Traditional DAQ here (which you could use for testing)

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3DFCF56A4E034080020E74861&p_...

Or you could consider upgrading to our newer DAQmx drivers, which simplify most Data Acquisition operations.

Best wishes,

 

Mark

0 Kudos
Message 4 of 4
(2,717 Views)