15 retrieval of setup data and configuration – Yokogawa PC-Based MX100 User Manual
Page 717
15-15
IM MX190-01E
MX100 for Extended API - Visual Basic.NET -
15
Retrieval of Setup Data and Configuration
Program Example 2
Module Module1
Public Sub Item()
Dim rc As Integer
Dim comm As Integer
Dim i As Integer
Dim strItem As String
Dim lenItem As Integer
Dim realLen As Integer
lenItem = 512
strItem = Space(lenItem)
'connect
comm = openMX100("192.168.1.12", rc)
'get
rc = getItemAllMX100(comm)
'loop by item
For i = DAQMX_ITEM_ALL_START To DAQMX_ITEM_ALL_END
'read
rc = readItemMX100(comm, i, strItem, lenItem,
realLen)
'write
rc = writeItemMX100(comm, i, strItem)
Next i
'set
rc = setItemAllMX100(comm)
'disconnect
rc = closeMX100(comm)
End Sub
End Module
Description
Overview
The program is an example of reading and writing all setup items. The following four
actions are executed.
•
Gets the setup data from the MX100 collectively.
•
Retrieves the setup data of the setup data field by item.
•
Writes the setup data in the setup data field by item.
•
Sends the setup data to the MX100 collectively.
Each item is retrieved and written from the first number to the end number.
Be sure to prepare string fields of sufficient size.
By saving and loading groups of item numbers and item strings, you can backup the
setup data.
For setup item numbers, see section 6.3.
15.2 Programming - MX100/Visual Basic.NET -