this is my first post, here. 🙂
I am currently trying to make a VI to use with a linear scale. The linear scale gives 2 TTL signals that have an offset of 90°. The change in distance of the linear scale is given by counting the rising and falling edges of both signals. See the following picture: Ua1 is signal 1 and Ua2 is signal 2. You can disregard the other signals.
Now, I want to count the 4 edges in order to translate the 2 signals into distance. This means that I need two-edge counters for Rising-Rising, Rising-Falling, Falling-Falling, Falling-Rising for the 2 signals. I tried making 4 two-edge counters in LabVIEW but that obviously does not work, since only one DAQ can access the TTL card or I did it wrong.
Once I manage that, I also want to include the direction.
My TTL card: NI 9402
My Heidenhain interface electronic: IBV 100 (http://www.heidenhain.com/fileadmin/pdb/media/img/598_160-23.pdf - also the source of the picture)
Hardware setup: Linear Scale -> IBV (Interface Elektronic) -> NI 9402 -> LabVIEW
Signals: 3 Analog -> 3 TTL -> NI 9402
I hope I did not double-post. Any help would be greatly appreciated.
Solved! Go to Solution.
What I would do is get them into LabVIEW by normal analog input, and then just perform an edge detection. that way you know exact postion of each rise/drop.
I don't know whether there is an easier solution with counters, but if there is, somebody will sure post in here.
Your linear scale is essentially a quadrature encoder.
There are a number of help topics on ni.com that will help you better understand the concept.
This would be a good starting point (http://zone.ni.com/devzone/cda/tut/p/id/4763)
I have used linear scales from Heidenhain in several applications.
As mentionned by the previous post, the output of your scale is like a quadrature encoder. Therefore you must use a counter input of the DAQ board to measure the position of the scale.
The desired X4 mode is done by the counter itself (not possible with some older boards from NI).
As a starting point, see Measure Angular Position.vi which ships with the LabVIEW examples. According to your linear scale, change the type of the polymorphic DAQmx Create Channel VI to CI Linear Encoder and the label of Pulses per Revolution to Distance per pulse.
Don't hesitate to post again if you should need further help.
Unfortunately I have never used the NI 9402 and therefore don't know the details about its unique counter.
But, because the NI 9402 is listed as a possible interface for above mentionned example, its counter should be able to interface the quadrature encoder type signals of the IBV 100.
Thank you all for the answers.
@ ABCPrograms: How would you do that? I am trying to find edge detection in LabView and came up empty so far. It is of interest to me to directly use the analog signals to be able to play around more.
@ JB: Thanks for the hints. So far it seems to work, but I am still working on getting the reference signal in ... let's see if that works.
In the mentionned example, enable the Z index and the counter will reset with the given value (z index value) each time the scale crosses the reference mark.
Notice that you must configure the Z index phase (levels of A and B when Z is active) according to the signals of the scale.