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

Page 257

Advertising
background image

4-10

IM MX190-01E

Retrieval of Setup Data and Configuration

Program Example 2

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

• Get setup data.
• Set setup data other than channel setup data collectively.

• Set the channel setup data
• Set a DC voltage range to the channel

Public Function main()
Dim sysinfo As MXSystemInfo
Dim status As MXStatus
Dim netinfo As MXNetInfo
Dim chconfig As MXChConfig
'connect
host = "192.168.1.12"comm = openMX(host, rc)
'get
rc = talkConfigMX(comm, sysinfo, status, netinfo)
Do
rc = getChConfigMX(comm, chconfig, flag)
Loop While (flag And DAQMX_FLAG_ENDDATA) = 0
'set
rc = setSystemConfigMX(comm, sysinfo)
rc = setChConfigMX(comm, chconfig)
'range
rc = setVOLTMX(comm, DAQMX_RANGE_VOLT_20MV, 1, 1, 0, 0, 0, 0,
0)
'disconnect
rc = closeMX(comm)
End Function

Description

Retrieval of Setup Data
talkConfigMX(comm, sysinfo, status, netinfo)
Declares the retrieval of the setup data.
Gets the setup data (system configuration data, status, and network information

data) excluding the channel setup data.
The system configuration data, the status, and the network information data are

stored in the MXSystemInfo, MXStatus, and MXNetInfo structures, respectively.

getChConfigMX(comm, chconfig, flag)
Gets the channel setup data for each channel.
The end is determined by the flag status of “end data.”

4.2 Programming - MX100/Visual Basic -

Advertising