Enable, Assign and Display Additional Analog Channels/Digital Bits

Begin by adding channel two to the ChannelList as shown in Figure 2.
Figure 2Add channel two to ChannelList
Note — channel two on your DI-148/158 corresponds to channel one in the ChannelList property (channel one on your DI-148/158 corresponds to zero).

Choose the object view and double-click DQChart on the VB toolbar (Figure 3). Resize and relocate the chart as you wish.
Figure 3Double-click DQChart in the toolbar to add a chart to the form

Set the DQChart Channel property to 2 in order to display channel two data (Figure 4).
Figure 4Set the DQChart channel property to 2

With the chart placed in the form and the Channel property set, add the DQChart to the chart list as shown in Figure 5.
Figure 5Add the DQChart to the chart list

Edit the DataqSdk1.ADChannelCount property to reflect the total number of channels enabled (Figure 6).
Figure 6Edit the ADChannelCount property

With the chart placed in the form and the Channel and DigitalMask properties set, add the DQChart to the chart list as shown in Figure 9.
Figure 9Add the DQChart to the chart list

Set the Direction of the Digital Bits

Before individual bits can be toggled the direction of the digital bits must be set.

The DigitalDir constant is used to set the direction of the digital bits (as outputs). This is accomplished by setting the DataqSdk1.DigitalOutput property equal to the DigitalDir constant. Individual bits can be set as inputs on the same line (Figure 10).

Figure 10Set the direction of the digital bits

Toggle Individual Bits (outputs only)

With the direction of the digital bits set individual bits can be toggled as shown in Figure 11. Each digital port assigned to DataqSdk1.DigitalOutput will output a 1 (high).
Figure 11Toggle individual bits