7implementing the talker function – Yokogawa PC-Based MX100 User Manual
Page 409
7-11
IM MX190-01E
DARWIN - Visual C++ -
7
Implementing the Talker Function
Program Example 4
This program retrieves the system configuration data. The program executes the TS
and CF commands of the DARWIN communication function.
//////////////////////////////////////////////////////////////
// DARWIN sample for talker
#include
#include "DAQDARWIN.h"
//////////////////////////////////////////////////////////////
int main(int argc, char* argv[])
{
int rc; //return code
CDAQDARWIN daqdarwin; //class
char line[BUFSIZ];
int len;
//connect
rc = daqdarwin.open("912.168.1.11");
//talker
sprintf(line, "TS%d" DAQDARWIN_TALK_SYSINFODATA);
rc = daqdarwin.runCommand(line);
rc = daqdarwin.sendTrigger();
rc = daqdarwin.sendLine("CF0";
do {
rc = daqdarwin.receiveLine(line, BUFSIZ, &len);
} while ((rc == 0) && (line[0] != ëE");
//disconnect
rc = daqdarwin.close();
return rc;
}
//////////////////////////////////////////////////////////////
7.3 Programming - DARWIN/Visual C ++ -