DoOutputMultiBit


Function

 

Outputs multiple bits to output bits.

 

Format

 

ret = dncDaq01.DoOutputMultiBit(DeviceNo, DoBit, DoBitNum, DoData)

 

Parameters

 

DeviceNo [ C#: short ] [ VB.NET: Short ]

Specifies the device No. managed by DncDaq.

 

DoBit [ C#: out short ] [ VB.NET: Short ]

Store the logical output bit numbers into an array, and specify the base address of this array.
The logical output bit number is a number, which is assigned consecutively from the first output bit of a device as 0 to the last one.

 

DoBitNum [ C#: short ] [ VB.NET: Short ]

Specifies the number of bits which are specified by DoBit. The maximum number of bits is 256.

 

DoData [ C#: out byte ] [ VB.NET: Byte ]  

Stores the output data into an array, and specify the base address of this array. Specifies the output data to either 0 or 1.

 

Return value

 

Ret [ C#: int ] [ VB.NET: Integer ]

 

■Common

Value

Description

0

Normality completion

500001

The method on an unconfigured device has been called. Check the device settings.

500002

The method was called that the device does not support.

510001

The input parameter is invalid. Check the parameter contents.

 

■DIO Devices

Value

Description

10100

Invalid data buffer address.

20102

The bit number exceeds the specifiable range.

20103

Bit number beyond the limit.

20104

Bit data beyond the limit of 0 to 1.

Other errors (see: Error code details)

 

Remarks

 

Outputs multiple bits to output bits. Before this function is called, it is necessary that the logical bit numbers to be output are set into the array specified by DoBit.
The data to be output are stored into the array named Data by the order of logical bits which are specified by DoBit.

 

Example

 

Outputs 1 to bit 0 and 0 to bit 1 respectively.

C#

int     Ret
short[] DoBit  = new short[2];
byte[]  DoData = new byte[2];

DoBit[0]  = 0;
DoBit[1]  = 1;
DoData[0] = 1;
DoData[1] = 0;
Ret = dncDaq01.DoOutputMultiBit(DeviceNo, DoBit, 2, DoData);

 

VB.NET

Dim Ret As Integer
Dim DoBit(1) As Short
Dim DoData(1) As Byte

DoBit(0)  = 0
DoBit(1)  = 1
DoData(0) = 1
DoData(1) = 0
Ret = dncDaq01.DoOutputMultiBit(DeviceNo, DoBit, 2, DoData)