08-03-2015 01:43 AM
Hi all, any help appreciated with the last (!) step in a very time consuming puzzle...
I have a PCI-6254 card with 2 x 64 channel breakout cables. Each cable goes to a remote box, each of which essentially runs a multiplexer and acquires analog signals.
Each multiplexer needs an array of 4-bit addresses (eg. 0 to 15) to cycle the multiplexer channels, which I can succesfully generate on port0\line0:3 which are found in cable 1 going to box 1.
My mission is now to duplicate this digital signal in the second cable going to the second box. For this card, Cable 1 has port0\line0:7 and cable 2 has port0\line8:31. I understand that it's a 32-bit port, so I need to send it a 32-bit address.
So I simply (!) want to send identical digital outputs on port0\line0:3 and on (say) port0\line8:11. They should be triggered by the same clock, etc.
Is this possible? However I try so far I can only generate an output on lines 0:3. From what I've read, I'm wondering if the whole of the port is tied up by writing a 32-bit number to the first 4 lines....
Thanks!
Solved! Go to Solution.
08-03-2015 02:05 AM - edited 08-03-2015 02:05 AM
Hi Dave,
yes, that's possible!
Simply create a DAQmx task for "Dev1/di0:3, Dev1/di8:11" to have 8 digital lines in your task…
The other option is to use the whole port and just set the bits/lines you need in your U16/U32 word!
08-03-2015 02:10 AM
I'm wondering whether you select all needed channels for the task you create. You can try to create separate tasks also, for example, with needed lines groups, like here:
08-03-2015 02:34 AM
Thanks both, really appreciate your input. I think I tried something like that today with no success but maybe I did it wrong. It ran without errors but just generated the output on 0:3. I'll try your suggestion in the morning (New Zealand evening now).
I think I need to replace the 1D boolean with a 1D U32 array to send the right bit address (I am sending the mux channels in a funny order, something like 4,0,3,6,10,etc). But then I fear that it will only run one task, as the whole 32-bit port is being addressed each time.
GerdW - could you explain how I would go about setting the right bits to send, say, a value to 4 to both sets of lines? I can't get my head around it...
Thanks guys!
08-03-2015 02:43 AM
Hi Dave,
a very simple (and not optimized) way:
Create your 4 booleans for the first 4 lines in the port and set them twice in a boolean array for the whole port.
When you want to optimize this you only need to use integer numbers and some simple math…
08-03-2015 03:13 PM
Done - thanks GerdW!
I set up a task using the whole port and then ran your snippet in a loop for each of the U32 addresses I need to call. Then I converted the Boolean array back to a U32 number for each, then used DAQmx Write with U32, 1 Chan NSamp to write the integer array.
Many thanks, and Kudos richly deserved for such a speedy solution.
Dave