04-22-2010 08:55 AM
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.
Solved! Go to Solution.
04-22-2010 01:06 PM - edited 04-22-2010 01:08 PM
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.
04-22-2010 03:05 PM - edited 04-22-2010 03:05 PM
tbob wrote:
[...]
a channel could consist of ports 0 and 1.
[...]
Yeah, it depends on how it's all set up....
04-22-2010 03:18 PM
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.
04-22-2010 03:32 PM
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".
04-23-2010 08:28 AM
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.
04-23-2010 09:01 AM
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?
04-23-2010 12:58 PM
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: