| Gordon Weast 2005-04-06, 12:54 pm |
| Ahsan,
Since the block wasn't built to directly take an 8 bit value and output
it, you have to determine the value of each bit and feed that to the
corresponding input to the block. Set it up for all 8 bits (channels),
then take your input number and use a data type conversion to change
it to a uint8. Feed the output of that to 8 AND blocks, one for each
bit, input & 1, input & 2, input & 4, input & 8, etc. The outputs of
the AND blocks go to the DO block. You might have to use another
data type conversion back to double after each of the AND blocks.
I know it's a bit clumsy, but that is how you will have to do it
unless you want to write your own digital out S function.
The AND blocks are inlined so they are quite efficient.
Gordon Weast
xPC Target Development
The Mathworks
ahsan wrote:
> How can I send an 8-bit value to the digital output of the PCI_6025E
> from a decimal value in simulink, using the XPC digital output block?
|