07-14-2016 12:19 PM
Does DAQmx soley work with NI hardware or can it work with other brands of equipment? If it cannot how would I start to make a block diagram for an optical encoder that stores the position of a stepper motor? Sorry for the newbie question, thank you.
07-14-2016 12:35 PM
DAQmx is specifically the driver for NI Data Acquisition Boards.
What optical encoder are you working with? How does it communicate with the PC? There are often LabVIEW drivers for 3rd party devices using serial port, GPIB, Ethernet, etc.
07-14-2016 12:44 PM - edited 07-14-2016 12:45 PM
I'm working with a Nanotech NOE2 which goes to a BrBoPr++, then goes to a microcomputer (Debian-Linux OS), then USB to the PC.
07-14-2016 01:17 PM
@kpwade wrote:I'm working with a Nanotech NOE2 which goes to a BrBoPr++, then goes to a microcomputer (Debian-Linux OS), then USB to the PC.
So then is completely depends on how the microcomputer decides to handle the protocol. Are you or somebody in your company in charge of that code? Or was it already done by a supplier?
If you have influence in the protocol, there are a lot of things we could do to make life simpler.
07-14-2016 01:27 PM
Assuming I have an influence, what could be done?
07-14-2016 02:02 PM - edited 07-14-2016 02:02 PM
So let's assume we are to recieve a single value with each transmission and nother else. What you would like then is to recieve data in an ASCII format with a Carriage Return (CR, 0xA) at the end of the data. For example, if your encoder value is 20.5, you would receive the string "20.5" with a CR at the end. This will make life very easy on the LabVIEW side since VISA can be set up to use a termination character. When the termination character is enabled, the VISA Read will stop reading when one of three things happen: the desired number of bytes is read, the termination character is read, or there is a timeout. So we just set the number of bytes to read to something more than we would ever expect to read and then we pretty much guarantee that we will read the entire message. Then your loop can be as simple as this.
07-14-2016 03:16 PM
@kpwade wrote:Does DAQmx soley work with NI hardware or can it work with other brands of equipment? If it cannot how would I start to make a block diagram for an optical encoder that stores the position of a stepper motor? Sorry for the newbie question, thank you.
As crossrulz said DAQmx is used with NI data acquisition boards and modules. I'm using a Sick encoder with an NI-9401 Digital I/O module on multiple setup and using DAQmx to get the encoder value. So you can use a third partie optical encoder but you will need an NI acquisition board to compute the encoder value with DAQmx.
Ben64
07-17-2016 09:14 PM - edited 07-17-2016 09:14 PM
How would I add channels to read/write 6 optical encoders at the same time rather than just 1?
07-19-2016 08:33 AM
Hi kpwade,
I would say it depends on how are you receving your data, because if you are getting the data in a single string then you can use LabVIEW functions to subset that string. There are manuals that can help you to better undersand about VISA.
http://www.ni.com/tutorial/3702/en/#toc4