09-14-2011 07:35 AM
Hi Ivy-
What do you mean when you say that it does not work? Does that mean that you do not get any data (or at least not the expected data)? Or do you get some error from DAQmx?
I suspect that your programming on one task may be consuming digital/PFI lines that the other task needs. It should be possible to work around this, but it might be helpful to post a screenshot of your code and a bit more info about what behavior you are observing.
09-14-2011 07:44 AM
Hi Tom,
By "does Not work", I mean I get wrong data. Data from counter1 are all 1. I am expecting to get a increasing number.
Please check the attached screen shot. Thank you and have a nice day!
09-14-2011 08:04 AM
Hi Ivy-
Two questions: What values do you have specified for Z-index enable and the other settings? And what is your sample clock source? I can't see it because it is scrolled off of the screen in the screenshot. If you post your VI I will try to take a look.
09-14-2011 08:32 AM
Hi,
For the set up of Linear encoder, please see the attached photo.
Sampling source is from analog card.
09-14-2011 08:35 AM
Hi Ivy-
I'll ask the obvious question: since you are always reading "1" and your z-index value is "1" and z-index resets are enabled, is it possible that your z-index Phase is being met and that the counter is always being reset? Do you actually want z-indexing enabled? What happens if you disable it; do you see better or at least changing results?
09-14-2011 09:00 AM
But When I swap counter, I have the same results. Counter 0 works fine but counter 1 recorded all 1.
09-14-2011 12:31 PM
Hi Ivy-
How do you have your signals wired into the module? If you are only swapping the counter names in software without changing the hardware configuration then I think you may be making some assumptions about the signal routing internal to the module and chassis that might not be exactly correct.
Do you have a schematic of how you have everything wired up to the module(s) and what type of behavior you are hoping to achieve?
09-14-2011 12:51 PM
Hi Tom,
I didn't do anything to the hardware. I am using NI 9411 chasis 9174. There is no counter in NI 9411. So my program use the counter of Chasis 9174.(I do NOT know how do the counters of 9174 wire to my digital input of NI 9411)
For the wiring of NI 9411: bit0--A pulse, bit1--B pulse. bit3--R pulse.
A,B,R pulses are for the the encoder.
09-14-2011 12:56 PM
Hi Ivy-
You're right- the 9411 does not have counters, but there are default terminals for routing through the 9411 and into the 9174 chassis counters. How do you have the signal that is to be counted on the simple event counting channel wired? Or is it to be one of the signals from the encoder? In order to properly import the signals you may need to use a DAQmx Channel Property Node to select the Input Terminal for the edge counting channel if it is a signal that is wired from one source into multiple terminals. You can do the same setting for each of the A, B, and Z/R lines as well. DIO0 corresponds to PFI0, and so on.
09-14-2011 01:09 PM
Yes, simple encoder count A pulse(so it only looks at the position. Do care about the direction).
I am still confused about why can't I use ctr0 and ctr1 together?