05-01-2014 01:39 PM
Perhaps I am getting close, thanks to your help.
On all of my tasks, I now have specified PXI1Slot2/PXIe_Clk100 as the reference clock, with 100e6 as the rate, before setting any other channel properties (as required according to the kb you pointed out earlier). When I start any of my counter tasks, they yield a -200077 error complaining that the rate must be either 10e6 or 20e6. If I change the RefClk.Rate on just the encoder and counter tasks to 10e6, I get an -89136 error. If I chage the RefClock.Rate to 10e6 on all my tasks, I get -200744 error: "Specified reference clock rate does not match the specified reference clock source", in addition to -89136 errors.
05-01-2014 03:27 PM - edited 05-01-2014 03:32 PM
"/PXI1Slot2/PXIe_Clk100" is a terminal on PXI1Slot2. For the other devices, you would specify "/<DeviceName>/PXIe_Clk100" or just "PXIe_Clk100".
To access the terminal on PXI1Slot2 from the other devices, the signal would be routed across the PXI_Trig bus. A reference clock sourced from the PXI_Trig bus can only be 10 or 20 MHz according to the specs. Even though the signal is originating from PXIe_Clk100, the way you are referencing it is causing it to be routed through the PXI_Trig bus which makes the 100 MHz frequency no longer valid.
This is more what I had in mind (although I don't have the actual hardware handy to validate it on):
EDIT: You'll want to explicitly set the reference clock source on the AI task's reference clock to "PXIe_Clk100" if you want it to also work in the case when the AI task only has one device.
Best Regards,
05-02-2014 12:45 PM
Thanks John. That VI was instructive. It looks like you have to set the reference rate along with the source in the second DAQmx timing call, otherwise I get an error complaining about the rate being zero. So I set the reference clock rate explicitly.
How did you post that code snippet inline? (And how did you extract it in labview?)
I was attempted to refactor things into subvis and typedefs. Hopefully it doesn't make it more difficult to understand. The main file is example_main. The first subvi in that file is the analog config, the second is the counters, the third is the encoders. As you see in the analog subvi, I explicitly set the PXIe_Clk100 src, and then pass that along to configure the counter and encoder tasks. I still get an error complaining that the rate would have to be 10 or 20e6, even though I changed the source to be "PXIe_Clk100" instead of "/PXI1Slot2/PXIe_Clk100".
I really appreciate you help and patience. I'm sorry its taking me so long to understand.
05-02-2014 12:58 PM
Did the example work as I posted it?
Yours is different in that it is setting the reference clock of the first task and then reading back the value from the property node to pass to the counters. This ends up putting the device prefix back into the terminal name and you're back to setting the terminal to "/PXI1Slot2/PXIe_Clk100".
To insert a snippet into your post to this forum, there's an insert/edit image button above where you type your message:
To create a snippet from LabVIEW go to Edit >> Create VI Snippet from Selection:
To copy the code into LabVIEW, just drag the image onto your block diagram. It doesn't work directly from a web browser without plugins though so you will probably have to save the image to your local computer first.
Best Regards,
05-02-2014 01:51 PM
Thanks John. I did not realize it was possible to import code by pasting a photo into a block diagram. I was not able to run the code as you posted, but I changed my own code as you suggested, and it is finally working.
So for the record, here are the basic outlines of the solution:
here is subvi 1, configuring the analog signals:
subvi 2, configuring counters:
and subvi 3, configuring encoders:
Really, thanks again for all your help. Its not much, but if you send me an email with your address, I'll send you a check for $50.