Discussion:
counting event using ni-6515
(too old to reply)
raider
2008-04-02 00:10:06 UTC
Permalink
Hello,im using a NI-6515 and wondering how to use it to as counter to count the pulse event generated
by a digital sensor.The pulse is usually less than 20ms only so i need a quick response from the Dgitital I/O.
Kindly include other similar example.Thanks!
mallorim
2008-04-02 23:40:07 UTC
Permalink
Hi raider,
For applications such as this, you would typically use event counting. However, this data acquisition task type requires that your hardware have a counter, which unfortunately, the 6515 does not.
The only suggestion I might make is modifying the Event Response.vi example program included with LabVIEW. This VI uses Digital Change Detection, which the 6515 supports, to control the iteration and execution of a timed loop. You could perhaps modify the example so that with each execution of the loop a numeric indicator was incremented. This might be done by taking a numeric constant of 0, wiring it to the loop and replacing the tunnel with a shift register to pass values from one iteration to the next, and then placing the increment function in the loop.
This example program can be found by navigating to the Help Menu>> Find Examples>> expanding the Hardware Input and Output folder>>expanding the DAQmx folder>> expanding the Control Folder>> and then looking in the Event Response file. When you click on an example VI, a brief description will appear in the Information box to the right of the Example Finder.
Hope this suggestion helps,
Mallori M.
raider
2008-04-03 12:40:13 UTC
Permalink
hello Mallorim,
Thanks for the prompt response.Im now exploring the option you suggested.Would you also recommend a continous loop that  will read the state of the input however im not sure if the loop can capture the quick events of the sensor.
Also i discovered that i purchase an wrong digital sensor.Im using an OMRON E3x-NA11  which is a NPN out sensor.I cant get any output when  i connected it to the my DIO since the sensor only sinks out the Vcc. How can i use my DIO without buying another sensor?
Thanks and again looking forward to a quick response from you and the NI team.
mallorim
2008-04-07 23:10:07 UTC
Permalink
Hi raider,
When you ask if I would recommend a continuous loop, did you mean replacing the true constant in the example program with a user controlled stop button? I would definitely suggest this. If however, that is not what you meant, could you please clarify? The point of using this timed loop as opposed to a regular while loop is that it will only execute/iterate when a pulse is seen on the digital line. Thus by using the increment function, we are counting every pulse.
You were worried about the speed of the program not being able to capture your 20 ms duration pulses. I don't believe that this will be a problem, since the program will be software timed. The Windows operating system is capable of 1 ms resolution and simply incrementing a number shouldn't take much processing time so I do not believe that you will having any timing difficulties.
The 6515 is capable of both sinking or sourcing so I am afraid I did not understand your last question.
Regards, Mallori M.
raider
2008-04-08 14:10:12 UTC
Permalink
hello Mallorim,
im sorry about the confusion. ive check your claims and indeed your correct.I just want to ask again if its normal that theres aslight voltage drop on my digital sensor output once i connected it with the DIO Input channel.I observed that my sensor output voltage was in nominal value(22-24v) but suddenly drop  once i connected it to the Input channel (i.e. Port0/Line1)Ive tried to added up a pull-up resistor to maintain a stable voltage but it seems not effective.how can i correct?Again thanks for your usual support.
mallorim
2008-04-09 20:40:10 UTC
Permalink
Hi raider,
Can I ask how big a voltage drop you are seeing? What is the voltage after connecting the sensor to the card, and are you measuring this with a scope or with a program?
If you take a look at the internal circuitry for the inputs of the 6515 in the <a href="http://digital.ni.com/manuals.nsf/websearch/4072E82D84C4DA7B86257291007CDB75" target="_blank">user manual</a>, there is a transistor that it takes power to drive. Therefore it is conceivable that the voltage drop you are seeing is due to this.
Are you just seeing a voltage drop and wandering as to its cause, or is there behavioral issues that you are experiencing? Like the sensor failing to reach the high logic level due to this drop?
Regards, Mallori

Loading...