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

Page 36

Advertising
background image

2-13

IM MX190-01E

MX100 -Visual C++

2

Retrieval of Setup Data and Configuration

Program Example 2

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

• Collective retrieval of setup data
• Collective setting of setup data

• Setting a DC voltage range for the channels

//////////////////////////////////////////////////////////////
// MX100 sample for configuration
#include <stdio.h>
#include "DAQMX.h"
//////////////////////////////////////////////////////////////
int main(int argc, char* argv[])
{
int rc; //return code
CDAQMX daqMX; //class
CDAQMXConfig configdata;
//connect
rc = daqMX.open("192.168.1.12");
//get
rc = daqMX.getConfig(configdata);
//set
rc = daqMX.setConfig(configdata);
//range
rc = daqMX.getConfig(configdata);
configdata.setVOLT(1, DAQMX_RANGE_VOLT_20MV);
rc = daqMX.setConfig(configdata);
//disconnect
rc = daqMX.close();
return rc;
}
//////////////////////////////////////////////////////////////

Description

Collective Retrieval of Setup Data
getConfig(configdata)
The setup data below can be retrieved by the collective retrieval of setup data.

• System configuration data: See the CDAQMXSysInfo class

(section 2.5).

• Status: See the CDAQMXStatus class (section 2.5).
• Basic settings: See the CDAQMXConfig class (section 2.5).

2.3 Programming - MX100/Visual C++ -

Advertising