With the help and idea of Vmax549 I aborted trying to manipulate the Modbus plugin to control my HY VFD and now attempting with the use of macros. I have 2 macros listed below and with inputting with UCCNC MDI I can turn spindle on/off.
//Turns spindle ON
System.IO.Ports.SerialPort myPort = new System.IO.Ports.SerialPort("COM1");
myPort.Open();
byte[] bytestosend = { 0x01, 0x3, 0x01, 0x01, 0x33, 0x88 };
myPort.Write(bytestosend, 0, bytestosend.Length);
exec.Wait(10);
myPort.Close();
__________________________________________________ ____________________
//Turns spindle OFF
System.IO.Ports.SerialPort myPort = new System.IO.Ports.SerialPort("COM1");
myPort.Open();
byte[] bytestosend = { 0x01, 0x3, 0x01, 0x08, 0xf1, 0x8e };
myPort.Write(bytestosend, 0, bytestosend.Length);
exec.Wait(10);
myPort.Close();
__________________________________________________ _____________________
What I'm trying to accomplish now is a Macro loop with "bool stateofmyLED = AS3.GetLED(50)" spindle CW led. Is it possible to call a macro within a macro? Or should it be written as 1 macro. Hoping for some info on best approach from you experienced macro writers. It will be extremely appreciated by me and for the safety of my monitor.