anyKode Marilou
ContentsIndexHome
Example
//Shows how to wait complete exec startup before connecting to MODA server

#include "Modacpp.h"
#include "conio.h"

#define MODASERVER "localhost"
#define MYROBOTNAME    "/"

int main(int argc, TCHAR* argv[])
{
ModaCPP::Connection *connection=new ModaCPP::Connection(true);

if(connection->WaitMODAServerIsRunningOnLocalhost(5000))
    {
    //exec is running and all servers are running
    if(connection->Connect(MODASERVER))
        {
        _cprintf("Connection ok to moda server\r\n");
        ModaCPP::RobotPHX *robot=connection->QueryRobotPHX(MYROBOTNAME);
        if(robot)
            {
            _cprintf("robot found\r\n");
            // ... your program here

            delete robot;
            }
        else
            {
            _cprintf("robot not found\r\n");
            }
        }
    else
        {
        _cprintf("Unable to connect to moda server\r\n");
        }
    }
else
    {
    _cprintf("Exec is not running ...\r\n");
    }

connection->Disconnect();
delete connection;
return 0;
}
Documentation v4.7 (18/01/2015), Copyright (c) 2015 anyKode. All rights reserved.