Yokogawa PC-Based MX100 User Manual

Page 685

Advertising
background image

13-16

IM MX190-01E

//connect
comm = openMX100("192.168.1.12", &rc);
//get
rc = getItemAllMX100(comm);
//loop by items
for (i = DAQMX_ITEM_ALL_START; i <= DAQMX_ITEM_ALL_END; i++)
{
//read
rc = readItemMX100(comm, i, strItem, BUFSIZ, &realLen);
//write
rc = writeItemMX100(comm, i, strItem);
}
//set
rc = setItemAllMX100(comm);
//disconnect
rc = closeMX100(comm);
#ifdef WIN32
FreeLibrary(pDll);
#endif
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.

Communication Connection
comm = openMX100("192.168.1.12", &rc);
The IP address of the MX100 is specified. This statement implicitly specifies the

communication constant DAQMX_COMMPORT (communication port number of the
MX100).

13.2 Programming - MX100/Visual C -

Advertising