9retrieval of setup data and configuration – Yokogawa PC-Based MX100 User Manual

Page 495

Advertising
background image

9-7

IM MX190-01E

DARWIN - Visual Basic -

9

Retrieval of Setup Data and Configuration

Program Example 2

This program executes the following two items. This program contains both items,
but each item can be written and executed separately.

• Retrieval of setup data
• Setting a DC voltage range to the channel

Public Function Main()
Dim line As String * 256
'connect
host = "192.168.1.11"
comm = openDARWIN(host, rc)
'get
rc = talkOperationDataDARWIN(comm, 0, 1, 0, 2)
Do
rc = getSetDataByLineDARWIN(comm, line, 256, lenLine,
flag)
Loop While (flag And DAQDARWIN_FLAG_ENDDATA) = 0
'range
rc = setVOLTDARWIN(comm, DAQDARWIN_RANGE_VOLT_20MV, 0, 1, 2,
0, 0, 0, 0, 0)
'disconnect
rc = closeDARWIN(comm)
End Function

Description

Talker
talkOperationDataDARWIN(comm, 0, 1, 0, 2)
Specifies the type of setup data to be retrieved (setup data of the operation mode)
and the channel range (channels 1 and 2 of subunit number 0).

Retrieval of Setup Data
getSetDataByLineDARWIN(comm, line, 256, lenLine, flag)
Gets the output by the talker function line by line in a 256-byte field.

The end is determined by the flag status of “end data.”.

Setting a DC voltage range to the channel
setVOLTDARWIN(comm, DAQDARWIN_RANGE_VOLT_20MV, 0, 1, 2, 0, 0,
0, 0, 0)
Sets the measurement range of channels 1 and 2 of subunit number 0 to 20 mV.
The scaling function is not used.

The constant 20 mV is used to specify the range type.

9.2 Programming - DARWIN/Visual Basic -

Advertising