02-10-2023 02:48 PM
I am getting output with dev0\line7:0 (Connector 0) but not getting output from dev0\line15:8 which outputs thru connector SCB-68A Connector 1 output ..
It does work thru the NI max Test panel , but not thru the code .
02-10-2023 03:33 PM
Try dev0\line8:15 instead.
-AK2DM
02-10-2023 03:36 PM
tried this--- I get output through the test panel dev0\line8:15 on connector 1-scb-68A,,, but not through by code. My code works for dev0\line7:0 though
any ideas.
02-10-2023 05:02 PM
The version of DAQmx Write you're using is for "single sample, single channel (port format)".
Port format means that each bit in the numeric value you write corresponds to a line on the digital port. You're writing a constant value of 255 (decimal format) which tells bits 0:7 to be high and bits 8:31 to be low.
This is (presumably) then masked against the lines that you actually configured to be part of your digital channel. So when the channel consists of lines 8:15, only the bits at those positions *actually* get written.
This might be a good time to right-click the 255 constant and choose "Properties" at the bottom of the popup menu.
- on the Display Format tab, select Hexadecimal, check the "Use minimum field width" box, set the width to 8, and then "Pad with zeros on left"
- on the Appearance tap, check the "Show radix" box. (And make this a habit for any non-decimal display formats)
In hex format, each set of 2 hex digits corresponds to 8 bits. So to set bits 0:7, you use hex 000000FF. To set the next group of bits 8:15, you use hex 0000FF00. For bits 16:23, you use hex 00FF0000.
You *could* calculate the corresponding decimal values and they'd work just fine, but hex format makes the pattern *so* much clearer. Now you just include the correct hex number in each of the cases where you select from among Port A, Port B, Port C. The lines you choose to configure and the numeric value you write need to match up.
-Kevin P
02-10-2023 05:15 PM
thank you very much for the fast response. It is greatly appreciated. I will try it soon as i get back in the lab next week and let you know.