LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ND_POSITION_MSR with PCI6602

Hello,

does anybody know if it is possible to invert the interpretation of the rotating direction with software ?

 

Thanks Andre

0 Kudos
Message 1 of 5
(3,427 Views)

Hi Andre,

 

I was wondering if you could provide some more insight into what you are trying to do.  What exactly do you mean when you say you want to change the rotating direction?

 

 

Regards,
Jordan F
National Instruments
0 Kudos
Message 2 of 5
(3,404 Views)

Hello Jordan,

 I've got one rotary encoder connected to my PCI6602. The application I've chosen is the ND_POSITION_MSR.

Now my problem:

If the rotation encoder turns right the counter counts up.

But I need also a mode that if the encoder turns right the counter counts down.

 

I've tried setting ND_UP_DOWN with ND_DOWN and ND_UP but if I do this the ND_POSITION_MSR is no longer aviable and I can't disguish the turning direction.

Next I tried to set ND_OUTPUT_POLARITY to ND_NEGATIVE but there was no effect at all.

Next I tried to change the ND_SOURCE to Channel B and the ND_AUX_LINE to Channel A but there was also no effect.

 

Furthermore I don't want to change anything in the GUI or in Hardware.

 

Thanks for your help

Andre 

 

0 Kudos
Message 3 of 5
(3,393 Views)

There is a pin on the 6602 that tells the counter whether to count up or count down (ctr0, Pin 48, PFI6/P0.6).  If you put a logic low on this pin, the counter will count down and if you put a logic high on this pin, the counter will count up.  So, you can either externally put a digital signal in this pin or you can try to internally route a digital signal to this pin.  I attached the E series User Manual that talks the hardware and software functions to do this.  Some helpful sections to review in this manual are: Counters, Getting Started with Counter Applications in Software, Routing Signals in Software, and Digital Routing.

 

E Series User Manual

http://www.ni.com/pdf/manuals/370503k.pdf

Message Edited by Jordan F on 02-02-2009 11:37 AM
Regards,
Jordan F
National Instruments
0 Kudos
Message 4 of 5
(3,364 Views)

Hello Jordan,

 

I've tried to set the ND_PFI_6 with the Signal_Select function like this:

for permanently positve:

Select_Signal(1,ND_PFI_6,ND_NONE,ND_POSITIVE); 

for permanently negative: 

Select_Signal(1,ND_PFI_6,ND_NONE,ND_NEGATIVE);  

 

an other try was

 

for  permanetly positive:

Select_Signal(1,ND_PFI_6,ND_PFI_5,ND_POSITIVE);  

for  permanetly negative:

Select_Signal(1,ND_PFI_6,ND_PFI_5,ND_NEGATIVE);  

 

but there was no effect at all.

 

Now the questions are:

Have I to associate the PFI6 with counter0 extra ?

Are there other Counters avaible then Counter 0 ?

 

Thanks André

 

PS: Can you send me a pice of sample code?

 

 

 

0 Kudos
Message 5 of 5
(3,354 Views)