LoggerGetChannelSetting


Function

Get the channel information.

Format

Ret = LoggerGetChannelSetting ( AppId , InputType , SequenceNum , ChannelNo , ChannelName , Range )

Parameters

AppId [ VB.NET: Short ] [ C++: short ] [ C#: short ] 

Specify Application ID retrieved by LoggerOpenApplication.

InputType [ VB.NET: UShort ] [ C++: unsigned short ] [ C#: ushort ]

Specify the input method.

SequenceNum [[ VB.NET: UShort ] [ C++: unsigned short * ] [ C#: ref ushort ]

Specify the address where the sequence number is stored.

ChannelNo [ VB.NET: UShort() ] [ C++: unsigned short * ] [ C#: out ushort[] ]

Specify the address where the channel number is stored.

ChannelName [ VB.NET: Byte() ] [ C++: char *] [ C#: out byte[] ]

Specify the address where the channel name is stored.
Please refer "Note of Using Visual Basic .NET" to know the way to convert a Byte array to a string variable on Visual Basic .NET.
Please refer "Note of Using Visual C#" to know the way to convert a Byte array to a string variable on Visual C#.

Range [ VB.NET: UShort ] [ C++: unsigned short *] [ C#: out ushort ]

Specify the address where the analog input range is stored.

Return Value

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

Definition

Return code

[Dec]

Description

LOGGER_ERR_SUCCESS

0

Normal completed

LOGGER_ERR_INVALID_ID

10010

Invalid AppId was specified.

The others (See also: Error Code List)

Remarks

Get channel information.
You can acquire the input method, channel name, and input range of each channel.
ChannelNo, ChName, and Range are array variables, and you can also acquire the processing sequence.

Example:

Sequence 1: hardware channel 2, channel 2, range ±10 V.
Sequence 2: hardware channel 0, test channel, range ±5v.
Sequence 3: hardware channel 1, ch1, range ±10 V.

The channel information is stored in order of processing sequence, starting with the youngest array index.

ChannelNo: [2, 0, 1]
ChannelName: [Channel2, test channel, ch1]
Range: [0, 1, 0]

Example

Get channel information.

VB.NET

Dim Ret As Integer

Dim InputType As UShort

Dim SequenceNum As UShort

Dim ChannelNo(255) As UShort

Dim ChannelName(255 * 255) As Byte

Dim Range(255) As UShort

 

SequenceNum = 256

 

Ret = LoggerGetChannelSetting(AppId, InputType, SequenceNum, ChannelNo, ChannelName, Range)

 

C++

long Ret;

unsigned short InputType;

unsigned short SequenceNum;

unsigned short ChannelNo[256];

char ChannelName[256][256];

unsigned short Range[256];

 

SequenceNum = 256;

 

Ret = LoggerGetChannelSetting(AppId, &InputType, &SequenceNum, &ChannelNo[0], &ChannelName[0][0], &Range[0]);

 

C#

int Ret;

ushort InputTypet;

ushort SequenceNum;

ushort[] ChannelNo = new ushort[256];

byte[] ChannelName = new byte[256];

ushort[] Range = new ushort[256];

 

SequenceNum =256;

 

Ret = logger.GetChannelSetting(AppId, out InputType, ref SequenceNum, out ChannelNo, out ChannelName, out Range);

 

See Also

LoggerSetChannelSetting