Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.

Get Started
Asked — Edited
Resolved Resolved by DJ Sures!

Listen To Eventhandler In C++ Without Gui

I'm attempting write a small c++ cli program with which I can connect to and control each servo. However, I am running in to the problem of making the connection without using a gui.
Does anyone have an idea of how I can listen to the eventhandler without using the gui?

What I have so far is this:

Code:

 
#include
#include
#include "stdafx.h"
using namespace std;
using namespace EZ_B;
using namespace System;

int main(){
EZ_B::UCEZB_Connect^ ezB_Connect1;
ezB_Connect1 = (gcnew EZ_B::UCEZB_Connect());
ezB_Connect1->Name = L"ezB_Connect1";
ezB_Connect1->Port = L"192.168.1.1:23";
ezB_Connect1->TCPPassword = nullptr;


Any help will be highly appreciated:)

Best regards,
Lars

PRO
Synthiam
#1  
Do not use UCEZB_Connect because it is a graphical user control (hence the UC in the naming convention).

Use EZ_B::EZB instead...

EZ_B::EZB will provide a Connect() method which you can call directly

Code:


EZ_B::EZB ^ezb;
ezb = gcnew EZ_B::EZB("MyEZB");
ezb->Connect(L"192.168.1.1");

for (int x = 0; x < 10; x++) {

ezb->Servo->SetServoPosition(EZ_B::Servo::ServoPortEnum::D0, 40);
System::Threading::Thread::Sleep(1000);

ezb->Servo->SetServoPosition(EZ_B::Servo::ServoPortEnum::D0, 120);
System::Threading::Thread::Sleep(1000);
}