23 retrieval of the measured data – Yokogawa PC-Based MX100 User Manual
Page 1085

23-7
IM MX190-01E
DARWIN for Extended API - C# -
23
Retrieval of the Measured Data
Program Example
using System;
using System.Text;
using System.Runtime.InteropServices;
namespace MeasCS
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
int rc;
Encoding enc = Encoding.GetEncoding ("ascii");
String address = "192.168.1.11";
//connect
int comm =
DAQDA100.openDA100(enc.GetBytes(address), out rc);
//get
rc = DAQDA100.measInstChDA100(comm, 0, 1);
int val = DAQDA100.dataValueDA100(comm, 0, 1);
//disconnect
DAQDA100.closeDA100(comm);
}
}
}
Description
Overview
Retrieves instantaneous values of the measured data from channel 1 of DARWIN
subunit number 0 and stores them in the field. Reads the measured values and
concludes the process.
Communication Connection
int comm = DAQDA100.openDA100(enc.GetBytes(address), out rc);
The IP address of the DARWIN is specified. This statement specifies the
communication constant for the DARWIN communication port number.
Retrieval of the Measured Data of Channel 1
rc = DAQDA100.measInstChDA100(comm, 0, 1);
Retrieves instantaneous values of the measured data from channel 1 of DARWIN
subunit number 0 and stores them in the field.
23.2 Programming - DARWIN/C# -