Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

PCIe-6363 recognized in device manager, but Matlab DAQ toolbox cannot read encoder

Solved!
Go to solution

Hi all,

 

I am trying to read the position of an optical encoder which has the typical wiring: ground, index, channel A, 5V, channel B. I was given a NI PCIe-6363 to try and read this data, and a terminal block to easily access the correct pins of the PCIe-6363. I am also trying to use Matlab's DAQ toolbox because I am familiar with that software and will be using it to interface with other sensors later.

 

1) I basically followed the NI getting started page where I downloaded and installed the DAQ driver, turned off the PC, plugged in my PCIe-6363, attached the terminal cable to connector 0 of the PCIe-6363 to connector 0 of my terminal block and turned the PC back on. In device manager, I see the image below device driver.PNG, which I take as being recognized successfully?

 

2) I then followed the pinouts for the PCIe-6363 for counter 0 which is PFI8 for channel A, PFI10 for channel B, and PFI9 for index/Z. I also am supplying the encoder with the 5V and digital ground available from the PCIe-6363. 

The setup is shown in the setup_1..2..3.PNG's. The terminal block being labeled DEV2, but I assume this is just how it was labelled in software when it came up whoever was using it before found it because mine (as you'll read later) comes as DEV1.

 

3) After all this I am following this matlab tutorial (also this video of the tutorial is nice, too) on measuring angular position of rotary encoders using NI instruments. I was getting all the same outputs, even the voltage error if you watched the video for hardware timed. It's a pretty straightforward tutorial, and I can see that the device is found and channels seen, shown in matlab outputs_1...2...3.PNG. The only difference is I get a timeout error when hardware timed, but I can try and figure that out later.

 

4) My problem is that when I move the encoder, the value encoderPosition in the code is always giving out a value of 0. I checked that I am getting 5V supply to the encoder with a multimeter which I am. I don't have an oscilloscope available at the moment to check the channels, but I did put my multimeter to them and was getting, according to the datasheet, the typical ~2V for the high signals, so I doubt the encoder is the issue. 

 

5) The only other problem I had was trying to register the device, shown in registration error.PNG, but I don't think that would be the problem, but anyway just throwing that out there.

 

I still think that there is some problem with it communicating with the computer, yet all seems good on drivers and wiring. I tried changing to connector 1 on the PCIe-6363 and the terminal block, but that did not help.

Thoughts?

Thank you, really could use the help.

 

- Chris

0 Kudos
Message 1 of 3
(968 Views)
Solution
Accepted by topic author t-osu

Sorry, can't help at all with the Matlab part of things.  The ~2V you measure for high state from the encoder signals could be a problem though.  That sounds likely to fall in the indeterminate range.  I like to see my lows well below 1.0V and my highs above ~3.5V.

 

You can do some further troubleshooting with MAX (NI's Measurement and Automation eXplorer app that gets installed with the DAQmx driver).   Select the device on the left and click on "Test Panels" on the right.  You can troubleshoot basic counter operation there.  Try out Edge Counting mode for each of Ch A and Ch B.   The result of this will tell you whether the problem is in the hardware (signal compatibility, wiring mistakes, etc.) or in your software.

 

 

-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 2 of 3
(955 Views)

Hey Kevin P,

 

Didn't realize that MAX tool; so helpful. Yes, the count is working properly for both A, B, and Z channels so I guess there is something going on with the Matlab software recognizing something. I will try posting for some help there.

Thanks for the quick reply though!

 

- Chris

0 Kudos
Message 3 of 3
(930 Views)