LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I read encoder signals using a NI MID-7604 Stepper Motor Drive and LabVIEW?

Hello,

I am fairly new to LabVIEW and was wondering how to implement incremental rotary encoders into a motion control VI.

I am using:
- LabVIEW 8.0
- NI PCI-7344 GPIB Card
- NI MID-7604 Stepper Motor Drive
- US Digital HB6M Rotary Incremental Encoders

I am attaching the VI's we are currently using to control the motors. We were able to get the encoders to work in NI MAX but are not sure how to code them into the LabVIEW VI. Any VI examples would be greatly appreciated.

Thank you for the help and advice!

-Kyle

---
College of Aerospace Engineering
Georgia Institute of Technology
Download All
0 Kudos
Message 1 of 6
(3,181 Views)
Kyle,

The NI-Motion driver automatically handles the use of encoders.  When you configure your axis for closed loop stepper it will automatically try to pull in to the correct position if it is off for some reason.  If you need to read the encoder position somewhere in your program, use Read Position.flx.

Regards,
Luke H
0 Kudos
Message 2 of 6
(3,148 Views)
Luke,

Thank you for the response. Where can I find the Read Position.flx? I have searched my hard drive and do not seem to have it. I am using LabVIEW 8.0 and NI-Motion 7.5.

Thanks,
Kyle
---
College of Aerospace Engineering
Georgia Institute of Technology
0 Kudos
Message 3 of 6
(3,081 Views)
Hi Kyle,
The read position.flx can be found on the function pallete (right click on the block diagram) under Vision and Motion»NI Motion»Trajectory. If you do a search on the function pallete for Read position it should come up.  If you still don't see it there let me know.  It is possible that Motion was installed without LabVIEW support. 

Regards,
GG
0 Kudos
Message 4 of 6
(3,064 Views)

Hi,

I could see two pallets one with name "Read Position" and other with name "Read Encoder Position". Can you tell me difference between these two?. In my case I want to read encoder pulses and I am using ni PCI 7340.

I am getting right values from "Read Position" pallete and "Read Encoder Position" is giving some random values which I couldn't interpret?. Can you suggest me which pallete I should be using for reading encoders? Any test codes for reading encoder would be great.

0 Kudos
Message 5 of 6
(2,442 Views)

Hi ShashiAchar,

 

I found this information in the Read Encoder Position VI's detailed help (Read Encoder Position😞

 

"The Read Encoder Position VI returns the quadrature count value of the encoder selected. The encoder must be enabled, either directly through the Enable Encoders VI or automatically, by being mapped to an enabled axis.

 

The Read Encoder Position VI is typically used to read the value of an encoder that is not part of an axis. This encoder could be a master encoder used for master-slave gearing or an independent position or velocity sensor.

 

For reading encoders mapped to axes, you can call this VI on the axis or directly on its mapped encoder. For servo axes, both approaches return the same value as the Read Position VI. On stepper axes however, this VI can return additional useful information.

 

During axis set up, you can operate the closed-loop stepper axis in open-loop mode and use this VI to directly measure the counts per revolution and steps per revolution for the axis. These values must be loaded in advance for subsequent closed-loop operation. Refer to the Load Counts/Steps per Revolution VI for more information."

 

From the Read Position VI Help, while using open-loop stepper axes, the VI returns the number of steps generated. If you have any other questions, please create a new forum post.

 

Josh

Applications Engineer

National Instruments 

0 Kudos
Message 6 of 6
(2,422 Views)