Can someone help please? I have been building a GUI to connect up to Arduino Mega Mini Pro board to run CNC GRBL. where, I am only utilising the GRBL to run B & C rotational axis (yes, the GRBL is 5 axis library). So, the GRBL compiles and loads up onto the Mega Mini Pro, just fine. The GUI is all good (I think) with its own little connection form that allows me to choose port and baud rate and connect. I load up the relevant G-Code and before I can press the run button, the GRBL seems to be receiving the instruction as soon as I load it up on the text display. also the highlight, meant to move one line at the time, but that isn't whats happening! Also, the Realtime display for the B & C aren't displaying anything at all! all though I can see on the output window of the VB2013, that GUI is talking to GRBL and GRBL is talking back as well as the display data is updated and sent back by GRBL, yet not displayed on the GUI! Also the buttons for +B,-B,+C,-C aren't working well either. meaning, there are intermittent responds from them, even though I've added delays for time to respond! not sure what I can do to make this GUI work. Can you help please? I am attaching the code here for both main form and the connection sub form, how do I post the image of the GUI? for the moment, I am not attempting anything with MPG. Main GUI:
Imports System.IO.Ports
Imports System.IO
Imports System.Windows.Forms
Public Class CNC4thand5thAxisControlGUI
Private WithEvents serialPort As New SerialPort()
Private gCodeLines As List(Of String)
Private currentLineIndex As Integer = 0
Private isPaused As Boolean = False
Private bPosition As Double = 0.0
Private cPosition As Double = 0.0
Private incomingDataBuffer As String = String.Empty
Private isExecutionComplete As Boolean = False
Private isGRBLReady As Boolean = True ' Indicates if GRBL is ready for next command
Private WithEvents tmrPosition As New Timer() ' Timer for position updates
' Initialize and start the timer for real-time position updates
Private Sub tmrPosition\_Tick(sender As Object, e As EventArgs) Handles tmrPosition.Tick
If serialPort.IsOpen Then
serialPort.WriteLine("?") ' Send status request to GRBL
End If
End Sub
' Form Load event
Private Sub CNC4thand5thAxisControlGUI\_Load(sender As Object, e As EventArgs) Handles MyBase.Load
gCodeLines = New List(Of String)
serialPort.BaudRate = 115200
ser