LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MAX DAQmx encoder PFI lines not carried through to Labview

Using MAX 15.0.0f0, I've setup a Global Channel as Angular Encoder counter measurement on a cDAQ 9401, selected PFI lines 0 and 1, saved it and ran it - works fine in MAX.

In labviev2014 I created a new task and added in the Global channel, used a DAQmx Channel property node shows the terminals are PFI0 and
PFI2.  Reading the counter input results in only 1's and 0's due to only seeing PFI0(phaseA) of the encoder.

 

Has anyone else had this issue?

 

Attaching screenshots of MAX and Labview front panel, and vi used (LV2014)

0 Kudos
Message 1 of 9
(3,243 Views)

Hi iiDaveii,

 

Counters are typically hardcoded to specific PFI lines. The property node in LabVIEW is returning the PFI lines which have been designated (in the hardware itself) as inputs for the counter in question. Have you manually changed the A or B input terminals in MAX after creating the global virtual channel? If so, those changes will not be reflected by the property node.

Tom D.
Staff Software Engineer
NI
0 Kudos
Message 2 of 9
(3,176 Views)

Hello Tom,

Thanks for the reply.

No, I changed nothing in MAX after setting up the Channels as Angular Encoders and selecting the PFI lines to be used for A and B.  The channel property node should have read what MAX was setup for - but did not.

 

If I don't use the Global Virtual Channels and instead create dynamic DAQmx channels within Labview code, and set the PFI lines with a property node - it works fine - but that kind of removes any use for MAX and eliminates easy re-configurability.

 

Attaching two vi's showing the outcome of this problem - I am unable to use more than one encoder on a cDAQ 9401 module if I use MAX Global channels.  Ctr3 is used for Frequency output to clock Ctr's 0 and 1 from for buffered angular encoder measurement.  But without MAX passing through the PFI line selections - the code breaks when trying to start the 2nd encoder counter task, indicating the lines are set for output.  This is an in-correct error - as can be seen in the second vi attached - if I hardcode dynamic channels and set them up exactly the same as the MAX config - it works fine.

 

 

Download All
0 Kudos
Message 3 of 9
(3,147 Views)

Hello again Tom,

In re-reading your response, I can see what you were saying and have been able to resolve this.

 

Summary:

In MAX, I had Encoder1 set to use Ctr0 for a physical channel and selected PFI lines 0, and 1 for the encoder input signals.  

Encoder2 was set to use Ctr1 for a physical channel and PFI lines 2 and 3 selected for the encoder input signals.

Ctr1 is apparently hardwired to PFI lines 4 thru 7.

I had setup Ctr3 to be a frequency output, to clock the encoder inputs, using it's default PFI line 5  -  this setup that nibble to be configured as outputs and caused the error due to the overlap with the Ctr1 using PFI 4-7 and being setup as an input.

 

For the resolution I configured Encoder2 to use Ctr2 for it's physical channel and still have PFI lines 2 and 3 selected for the encoder input signals.

Ctr2 appears to be hardwired to PFI lines 0 thru 3, which is same as Ctr0, and same as Encoder1 - all set as inputs so that nibble will be setup as inputs and will no longer conflict with Ctr3 being an output to the other nibble.

 

I had to study the pinouts for the counter terminals in order to determine this and see the overlap.

Counter/Timer Signal Default Pin Number Signal Name
CTR 0 A 14 PFI 0
CTR 0 SRC 14 PFI 0
CTR 2 AUX 14 PFI 0
CTR 2 B 14 PFI 0
CTR 0 GATE 16 PFI 1
CTR 0 Z 16 PFI 1
CTR 2 OUT 16 PFI 1
CTR 0 AUX 17 PFI 2
CTR 0 B 17 PFI 2
CTR 2 GATE 17 PFI 2
CTR 2 Z 17 PFI 2
FREQ OUT 17 PFI 2
CTR 0 OUT 19 PFI 3
CTR 2 A 19 PFI 3
CTR 2 SRC 19 PFI 3
CTR 1 A 20 PFI 4
CTR 1 SRC 20 PFI 4
CTR 3 AUX 20 PFI 4
CTR 3 B 20 PFI 4
CTR 1 GATE 22 PFI 5
CTR 1 Z 22 PFI 5
CTR 3 OUT 22 PFI 5
CTR 1 AUX 23 PFI 6
CTR 1 B 23 PFI 6
CTR 3 GATE 23 PFI 6
CTR 3 Z 23 PFI 6
CTR 1 OUT 25 PFI 7
CTR 3 A 25 PFI 7
CTR 3 SRC 25 PFI 7

 

Wow - this seems like it should be much easier than this...

 

So now it appears I can really only use 2 encoders with a cDAQ 9401 module, unless I have some other timing source for to clock them from. (I'll be using the AI sample clock to clock the counters).

 

Not only that, but since these counters are in the chassis of the cDAQ 9188, and there is only 4 of them - then only 4 encoders could be used on an 8 slot chassis no matter how many 9401 modules you want to put in there.  Is this right? or is there some workaround?

Why is there not a counter module for cDAQ that actually has counters in it?

 

Anyhow, thanks for the feedback and help to find the resolution.

Hopefully this post will help others.

0 Kudos
Message 4 of 9
(3,131 Views)

Hi iiDaveii,

 

NI does also offer the 9361, which is a cDAQ module designed for counter measurements that supports measurements of up to 4 encoders at once. The manual is located here: http://www.ni.com/pdf/manuals/374646a.pdf

 

It may be more useful for your application if you are trying to use more than two counters at once. The 9401 is unfortunately subject to those wiring conflicts because it wasn't designed specifically for using all four counters at once.

Tom D.
Staff Software Engineer
NI
0 Kudos
Message 5 of 9
(3,110 Views)

Hi Tom,

Thanks for the info on the other module.  We're ok with this setup for now, but I'll definately keep it mind for the next machine.

 

Just for clarity's sake - how many encoders could be ran from one 9188 chassis using those modules?

0 Kudos
Message 6 of 9
(3,102 Views)

Hi iiDaveii,

 

The chassis itself doesn't have any encoders. However, it is capable of outputting four counter signals, which could all be read simultaneously by one of the 9361 modules.

Tom D.
Staff Software Engineer
NI
0 Kudos
Message 7 of 9
(3,074 Views)

Hi Tom,

Yes I realize there is no encoders within the 9188 chassis.

The question is, if I filled all 8 slots of a 9188 chassis with the 9136 modules, how many encoders would I be able to connect to the 9136 modules and collect position data from simultaneously?

 

We have a machine design coming up that will have numerous encoders - we are trying to understand how many chassis / modules will be required.  It is appearing that only 4 encoders would be able to be ran from a 9188 chassis regardless of how many modules we put in there.  Each encoder will be using up 1 counter.

 

Thanks

0 Kudos
Message 8 of 9
(3,059 Views)

Hi iiDaveii,

 

The limitation lies in the origin of the counter signals. It is true that the 9188 chassis is only capable of outputting four counter signals. However, If your counters are external to the chassis/modules, you should be able to read four different encoders (or eight counters) simultaneously for each 9361 module inserted into the chassis.

 

I'd recommend using NI MAX to set up a simulation of the system you are planning on building. This should shed some extra light on the specifics, as far as what PFI lines you'll be using. Both the 9188 chassis and 9361 module can be simulated in MAX. Here is a tutorial on simulating devices: http://www.ni.com/tutorial/3698/en/

Tom D.
Staff Software Engineer
NI
0 Kudos
Message 9 of 9
(3,023 Views)