Hello Tuch,
Writing to the CWDIOPort.Assignment property determines the direction (input or outpu) of the port you are configuring. The property can take on four different values: 'cwdioInput' which sets the whole port for input, 'cwdioOutput' which sets the whole port for output, 'cwdioUnused' if the whole port is not used, and 'cwdioLineConfigured' which allows you to specify direction for a port on a line-by-line basis using the LineDirection property. You can write to the LineDirection property with a decimal number. The binary representation of that decimal number represents the input and output configuration of the port. For example, with an 8 line port, writing a binary value of 00001111 will set the first four lines for input and the next four for output. The decimal representation of the binary number 00001111 is 15, so you write a value of 15 to the LineDirection property to configure the port as such. Here are the commands used to write to the Assignment and LineDirection properties.
CWDIO1.Ports.Item(0).Assignment = cwdioLineConfigured
CWDIO1.Ports.Item(0).LineDirection = 15
So if you have the user making selections for the direction of the lines in the port, you can build these boolean values into an 8-bit binary integer, convert binary to decimal, and write that value to the LineDirection property.
For more information about the specifics of the CWDAQ ActiveX control, see the cwdaq.chm help file installed under C:\Program Files\National Instruments\MeasurementStudio\Help.
I hope this helps,
Travis G.
Applications Engineering
National Instruments
www.ni.com/support