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

12-18
IM MX190-01E
Retrieval of Setup Data and Configuration
Program Example
//////////////////////////////////////////////////////////////
// MX100 sample for items
#include
#include "DAQMX100.h"#include "DAQMXItems.h"
//////////////////////////////////////////////////////////////
int main(int argc, char* argv[])
{
int rc; //return code
CDAQMX100 daqmx100; //class
int i; //counter
char strItem[BUFSIZ];
int realLen;
//connect
rc = daqmx100.open("192.168.1.12");
//get
rc = daqmx100.getItemAll();
//loop by items
for (i = DAQMX_ITEM_ALL_START; i <= DAQMX_ITEM_ALL_END; i++)
{
//read
realLen = (daqmx100.getClassMXItemConfig()).readItem(i,
strItem, BUFSIZ);
//write
rc = (daqmx100.getClassMXItemConfig()).writeItem(i,
strItem);
}
//set
rc = daqmx100.setItemAll();
//disconnect
rc = daqmx100.close();
return rc;
}
//////////////////////////////////////////////////////////////
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.
12.3 Programming - MX100/Visual C++ -