Machsupport Forum
		Mach Discussion => Mach SDK plugin questions and answers. => Topic started by: magnetron on April 02, 2014, 04:25:37 PM
		
			
			- 
				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
 
 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);
 }
 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();