33
« on: March 23, 2022, 11:56:30 AM »
SendSerial(“Hello, world!” & chr(10) & char(13))
I see the above would work. Except for in the place of Hello World I would need a variable
This variable should be the data that was entered into the command line (If that is what it's named?)
or from the G-codes whenever it encounters the M6 code for a toolchange.
I'm not sure how to code this?
the sequence should be something like:
Sub Main()
Dim Tool_Change As String
'for the first tool:
'how do you grab the data from the g-code after m6 or from the command line??
If the command line value = M6 T0101 Then
ReadLine(Tool_Change) 'Or here the function for whatever is used for the command line??
SendSerial("1") 'send the number 1 to the arduino
end if
'for the second tool:
If the command line value = M6 T0202 Then
ReadLine(Tool_Change) 'Or here the function for whatever is used for the command line??
SendSerial("2") 'send the number 2 to the arduino
end if
'for the third tool:
If the command line value = M6 T0303 Then
ReadLine(Tool_Change) 'Or here the function for whatever is used for the command line??
SendSerial("3") 'send the number 3 to the arduino
end if
and so on for the rest of the tools or maybe later on an array for all 12 tools, just as simple as possible as the arduino already does everything it just needs that number from the serial.
End Sub