LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Write:Digital 2D U8 NChan NSamp question

Solved!
Go to solution

The help file says that for the "Digital 2D U8 NChan NSamp" vi, each row of U8s is one channel and each column is a sample. But does each U8 sample get expanded to 8 bits? If so, which bit is first (MSB or LSB)?

 

If not, how is the U8 sent to the hardware. Is the U8 a port sample where each bit in the value corresponds to a line on a port? If it is this scheme, then I guess that if you had 3 lines in a channel, that the upper 5 bits of the U8 would be unused. I'm also guessing that all the lines in a channel would need to be on the same port.

 

I guess my confusion comes from the fact that I think of a digital channel as one bit wide, while the literature seems to indicate that a digital channel can be composed of multiple bits.

 

 

--

Brian Rose
0 Kudos
Message 1 of 8
(3,950 Views)
Solution
Accepted by topic author Mister_Rose

I don't have a DAQ DIO to confirm this, but I think the LSB of the U8 goes to the port x line 0 (D0) , up to the MSB going to the port x line 7 (D7).  So if you had 3 lines in a channel, the upper 5 bits of the U8 would be ignored.  Yes, all lines would have to be on the same port.  If the polymorphic selection is U8, then you need to have 8 lines on the same port.  If U16, two ports are concantenated together to form 16 lines that correspond with the U16.

 

I too tend to think of a digital channel as one line.  The terminology is confusing.  They should not mention the word channel at all.  It should be ports and lines only, like port 0 line 0 up to port 0 line 7, then port 1 line 0, and so on.

 

For the phrase "each row of U8s is one channel ", I would think that meant that one channel is the 8 lines from one port.  In other words, the channel is a port.  I guess they use channel because if you are specifying U16, a channel could consist of ports 0 and 1.

 

Message Edited by tbob on 04-22-2010 11:08 AM
- tbob

Inventor of the WORM Global
Message 2 of 8
(3,937 Views)

tbob wrote:

[...]

a channel could consist of ports 0 and 1.

 

[...]


Yeah, it depends on how it's all set up....

 

Message Edited by Broken Arrow on 04-22-2010 03:05 PM
Richard






0 Kudos
Message 3 of 8
(3,920 Views)

Broken Arrow wrote:

Yeah, it depends on how it's all set up....

 


That is why I used the word "could".  But I'm glad you pointed that out.  The word "channel" is used to describe how it is set up.

- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 8
(3,912 Views)

tbob wrote:

Broken Arrow wrote:

Yeah, it depends on how it's all set up....

 


That is why I used the word "could".  But I'm glad you pointed that out.  The word "channel" is used to describe how it is set up.


That is why I used the word "Yeah".

Richard






0 Kudos
Message 5 of 8
(3,902 Views)

So if it is set up for "one channel for each line" does the U8 represent 1 bit or 8 bits. Will it simply take bit0 of U8 and discard bits 1-7 or is bit0 the first sample, bit 1 the second sample, etc.

 

--

Brian Rose
0 Kudos
Message 6 of 8
(3,887 Views)

Mister Rose wrote:

So if it is set up for "one channel for each line" does the U8 represent 1 bit or 8 bits. Will it simply take bit0 of U8 and discard bits 1-7 or is bit0 the first sample, bit 1 the second sample, etc.

 


 

I'm not sure how it would work, but to me, it just simply would not make sense to use a U8 to express the input switch for a single bit. Do you really need to use the U8? What about a very explicit set of boolean inputs?
Richard






0 Kudos
Message 7 of 8
(3,881 Views)

Mister Rose wrote:

So if it is set up for "one channel for each line" does the U8 represent 1 bit or 8 bits. Will it simply take bit0 of U8 and discard bits 1-7 or is bit0 the first sample, bit 1 the second sample, etc.

 


The setup depends on your intended usage.  If you use one channel for each line, don't use a U8 input.  Use a boolean instead.  You can select the type of input from the polymorphic selector in DAQmx.  In your scenario that you describe above, only bit0 of the U8 will be used (I think - I don't have equipment setup to test it).  To avoid confusion, stick to booleans for one channel for each line.  See the examples below:

 

dig_BD.png

 

- tbob

Inventor of the WORM Global
Message 8 of 8
(3,863 Views)