LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieving Data from a Quadrature Encoder using VISA Read

Hi community, I'm in the process of creating a tension testing software using labview, i'm not a pro with labview so i'm taking it step by step. The load cell is hooked up to a quadrature encoder and while i've been able to read the data from the load cell, i'm completely lost on how to get the data from the encoder. The encoder is connected to an "AD4B-D quadrature to RS232 Adapter" and that is connected to a serial port thats connected to the computer. All the videos i've seen on encoders only show those that are connected via USB so if anyone can help that would be perfect. I attached some pictures and the datasheet for the encoder if it would help.

Download All
0 Kudos
Message 1 of 12
(319 Views)

You should have attached the AD4B-D datasheet and not that of your encoder, as you need to get the data from the adapter.

 

santo_13_0-1718300170486.png

 

The manual states they provide a windows library and example to talk to the AD4B. Another note is that it talks in binary not human readable

santo_13_1-1718300263765.png

 

 

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 12
(308 Views)

Hello community, very new to labview. I have a Quadrature Encoder that I would like to read linear distance from using labview. Currently. we have a device that connects the encoder to a serial port which goes to the computer, but that device has been discontinued for almost 20 years along with its software. I would like to know the best DAQ device to use to connect the device to my computer and i would like one that works with the DAQ Assistant as it seems to be the easiest an most popular way to read data from an encoder.

0 Kudos
Message 3 of 12
(306 Views)

Hi. Thanks for this. Got in touch with the company and that product has been discontinued, along with the encoder, for more than 20 years.

0 Kudos
Message 4 of 12
(251 Views)

Please don't create multiple threads for the same topic:  Quadrature Encoder Data Acquisition - NI Community

 

Even most of the cheap multi-function DAQs will have counter and digital inputs that will be fine for your encoder.  See this KnowledgeBase article to get started:  NI Hardware Encoder Measurements: How-To Guide - NI

 

DAQmx has built-in Counter Input VIs to read most encoders.  Look in the Example Finder under Hardware IO > DAQmx > Counter Input:

NIquist_0-1718388272409.png

Do NOT consider the DAQ ASSistant!  It is useless for anything more complex than reading a simple voltage line.  Plus, none of us use it, so we can't advise you on it. 

 

If you have any cheap NI DAQ with counter inputs, you should be able to get some results easily.  If you need to buy one, just make sure the top frequency you intend to measure is covered by that DAQ.  Unless you need high RPM, it should be fine to use a cheap USB DAQ.  Even the USB-6002 I have here can count at 5MHz.  Dedicated digital DAQs are faster.

 

Let us know what you have for hardware and we can provide more specific help...

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 5 of 12
(234 Views)

Also easy, extremely popular (once upon a time), but limited:

 

Kevin_Price_1-1718388774240.gif

 

The point being: don't limit yourself to the DAQ Assistant.  Learn to advance beyond it ASAP, even if it seems helpful in the very very beginning.

 

As to DAQ hardware, you'll need a little bit of a budget for NI equipment.  You should be looking for a device with counters, specifically ones that support quadrature encoders.  That'll rule out low-cost devices like the USB-600x family. 

    Any modern-era cDAQ chassis will have such internal counters but you'd also need a suitable Digital module to provide a signal interface from the encoder to the chassis.

    Alternately, an X-series multifunction device would be very suitable and flexible.  An older M-series device could work too if you already have one available, but if buying new you should stick with X-series.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 6 of 12
(276 Views)

Oops, Kevin made a good point in the other thread.  My little USB DAQ has only one counter input, so it's fast enough, but no good for quadrature.  He's the DAQ expert around here, so I will leave it to him to advise on the best hardware.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 7 of 12
(228 Views)

If you want an easy-to-use option, this seems to be simple - https://www.usdigital.com/products/accessories/interfaces/usb/qsb/?q=QSB-S

and comes with a simple ASCII command set to interface - https://www.usdigital.com/media/gwqpsnym/qsb-commands-list.pdf

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 8 of 12
(259 Views)

I really am open to learning and obviously if there are alternatives that would mean the company gets to spend less money then i'm all for it. The LABVIEW software i'm creating will be used for a tension tester, and the digital encoder is used to measure the distance that the load cell travels. what device would you suggest.

0 Kudos
Message 9 of 12
(244 Views)

I really like the low-cost option Santhosh found and linked.  Just be aware that you'll be a lot more "on your own" to work through the programming API, and what you learn from the process won't transfer very directly to future tasks.  That's one part of the hidden value of DAQmx and NI gear -- there's quite a lot of commonality to the API and much of what you learn transfers pretty cleanly to future apps.

 

Also FWIW, if you think you'll need to synchronize the encoder data to load cell readings or other things, the serial interface will limit you.  Since the existing equipment was also serial based, perhaps it won't matter, but then again maybe sync'ing would *always* have been preferred but just not previously practical.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 10 of 12
(226 Views)