02-13-2013 08:01 AM
LV 2010, LV RT
I'm an old hand at DAQ and I've used RTSI before, but I'm having trouble with PFI lines.
I'm on a PXI 6602: 8 COUNTER I/O, and 32 Digital I/O ports.
I'm trying to construct a quick-and-dirty digital oscilloscope (I don't have a real one) to verify correct operation of another piece of software which is supposed to control the COUNTER outputs.
The example READ DIG CHAN - INT CLK - DIG REF doesn't work here: it complains that I can't use SAMPLE CLOCK on a digital input task on this board.
I can't seem to make the connections I want.
Attached is what I'm trying - and I can't even get one counter to read another.
Eventually, I want to connect CTR0 output (which is what my real program is controlling) to a digital input port, and use CTR7 as a 1000Hz Oscillator and sample that digital port, I can then look at that data and judge whether my program is working or not.
Forget the disabled part, what I THINK I'm doing is setting up CTR7 as a 1000 Hz oscillator, and telling the output to appear on PFI37.
I'm also setting up CTR6 to count edges (just to see if the oscillator is running), and telling it to look at PFI37 as an input.
I start both tasks, wait 1000 mSec, then READ Ctr 6 and clear both tasks.
What I read is always 1 - I would expect to read 1000 more or less, but I always get exactly 1.
Does setting the CI.COUNTEDGES.TERM take the connection AWAY from the CO.PULSE.TERM ???
I've tried using the ADVANCED terminals to connect the INTERNAL OUTPUT of CTR7 to the SOURCE of CTR6, with and without the CO.PULSE.TERM and CI.COUNTEDGES.TERM connections, but no joy.
The device is named "CTR". I have successfully used the CI.COUNTEDGES.TERM in my real application - I know that it works to connect to the outside world.
What am I missing?
Blog for (mostly LabVIEW) programmers: Tips And Tricks
02-13-2013 08:13 AM
I should mention that there are no errors reported by the above program.
Attached is a variation - I removed the terminal assignments, and tried to make a connection internally.
It complains that the START task needs resources that I have already used.
Should I make the connection AFTER I start the task? That makes no sense to me...
Blog for (mostly LabVIEW) programmers: Tips And Tricks
02-13-2013 08:17 AM
If I do START the task and THEN make the connection, I get an error at the CONNECTION vi, because the resources are already in use from the TASK.
There's something fundamental that I'm missing...
Blog for (mostly LabVIEW) programmers: Tips And Tricks
02-13-2013 08:37 AM
Even using the defaults, I cannot connect PFI8 (default CTR7 OUT) to PFI 15 (default CTR6 SOURCE) because "the hardware doesn't support it".
I cannot connect PFI8 (default CTR7 OUT) to /CTR/CTR6Source as that requires resources used by the task already.
I cannot connect /CTR/Ctr7InternalOutput to /CTR/PFI15 (default CTR6 SOURCE) because "the hardware doesn't support it".
Surely, all this PFI stuff can't be as useless as it appears...
Blog for (mostly LabVIEW) programmers: Tips And Tricks
02-13-2013 08:50 AM
Without reading all that stuff..... it seems to me that you try to create internal connections between different counters. That ist best done using "internal connectors" which are not listed in the default terminal selectors.
You can include those terminals by right click the constant and select "I/O Name Filtering". In this dialog, select the option to show advanced terminals as well.
It is also possible that due to the grouping of counters on the 6602 specific routes are indeed not possible.
You can use MAX to display possible routes for specific DAQmx devices. Select the device and switch to the tab "Device Routes".
hope this helps,
Norbert
02-13-2013 09:02 AM
I mentioned I had used advanced terminals, to no good effect.
I did not know about the Route Table, though. that tells me that I am expecting too much.
Thanks for the tip !
Blog for (mostly LabVIEW) programmers: Tips And Tricks
02-13-2013 09:22 AM
Well, still no joy.
The Route Table shows that I may indeed make a connection from Ctr7 Internal Output to CTR6 Source (upper left of this pic):
Yet, when I try to do that, the connection cannot be made, because the resources are already in use:
If I put the connection BEFORE the START TASK, then the same error occurs at the START TASK.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
02-13-2013 09:31 AM - edited 02-13-2013 09:32 AM
Maybe you should, for debugging, pass names to the tasks....taskname <3E> is not very...suitable.
The dialog states that PFI15 is already connected to Ctr6Source. PFI15 by default is the input for external signals for counter 6. So this is somehow expected since you already configured a full task to cover this connection. You simple try to add a new connection to Ctr6Source, which would short circuit PFI15 to Ctr7InternalOutput....
Without testing it right now, it should better like that:
Norbert
02-13-2013 09:39 AM
Well, that's where I started out, basically.
Here's another shot at the code. I just ran.
No errors reported, but the data I read is exactly 1. I'm expecting 1000 more or less.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
02-13-2013 09:55 AM
I can't even do it with the default connections.
Ctr7 output by default goes to PFI8, which is also the default input for line 8 of the digital input port.
So, I'll just look at the output of the counter, using the input port, right?
Wrong.
Blog for (mostly LabVIEW) programmers: Tips And Tricks