Hello Guest it is April 18, 2024, 01:33:04 AM

Author Topic: help ! sending UDP data from within mach plugin wizard it gives error : 9988  (Read 2365 times)

0 Members and 1 Guest are viewing this topic.

hello forum ,

I am playing with mach plugin wizard - it compiles without error 

I am trying to send a 5 byte packet with UDP from inside the Update function
however when I start Mach 3 and select the plugin it gives
Art code 9988 ( and then 9991 ) immediately and windows shut it down

what I am doing wrong ? please help - thank you

Code: [Select]
void UDPsend(void){
array<Byte>^bytesToSend = gcnew array<Byte>(5);
bytesToSend[0]=10;
bytesToSend[1]=10;
bytesToSend[2]=10;
bytesToSend[3]=10;
bytesToSend[4]=10;

int i=Global::udpSvr->Send(bytesToSend , bytesToSend->Length, SocketFlags::None);
}

Code: [Select]
void  MyDeviceClass::Update()
{
char buffer[128];
static  int divider;
sprintf_s(buffer,"Mach Coordinates :X(%12f) Y(%12f) Z(%12f) A(%12f)",
GetDRO(800),GetDRO(801),GetDRO(802),GetDRO(803));
console->ConsolePrint(0,1,buffer);
if(divider++%10 == 0)
{
DumpConfig();
}
SendHoldingMovement();
GetInputs();
SetOutputs();
HandleSequences();

UDPsend();