VB 2010 Arduino G Code

Hi everyone,

I have a couple of questions pertaining the I/O programming in VB.2010.
To start i was wondering how to detect the device when it is plugged in using VB, I have been successful using VB to communicate with a very basic sketch but the port needs to be defined each time, no good if i want to compile down the road.
Also wondering if I can use Marlin, or Teacup firmware and just have a simple program that uses a .txt file containing G code or M code, to move X,Y,Z, nothing else.
If I can, how do I modify the firmware, and how do I send packets to the Arduino, should it be line by line? If this is unreasonable how do I predefine the "G" code and create a library?
Any help would be greatly appreciated, I am very new to all this.

on windows, the usb serial ports are virtual and are only created when needed. The best you can do is remember what port was used last and hope it is still the same, also offer a drop down list with the other selections. You can find weather the arduino is plugged in by checking device names for an arduino board.

Maybe you can set the port by using command line parameters to pass in the port when the app is executed.

And I have no idea what teacup, marlin, 'G' codes, and 'M' codes are.

I have written program which has combobox to determine port name and communication rate then it analyzes serial input data , and stores it to database . this program is written on Visual C# .

Marlin and Teacup are Firmware sketches for the open source 3D printer.
Just wondering what part of the sketch I would need, and how do I send the "G" code line by line to the Arduino sketch using VB 2010?
Thanks for answering my question about using VB to detect the port.
How do I detect it using C language if VB won't work, basically I am interested in the feature included with the Arduino IDE GUI.

crobb09:
Thanks for answering my question about using VB to detect the port.
How do I detect it using C language if VB won't work, basically I am interested in the feature included with the Arduino IDE GUI.

I find it unlikely that VB2010 dropped the ability to "list available serial ports". It was in VB6 and is the simplistic method the IDE uses.

That's good news, I am enjoying this Visual Studio VB 2010 and would like to use it for the port detection, can you point me in the proper direction?
Thanks,

Rob

Searched google for "VB2010 list serial ports"

Got:
Dim myPort As Array ‘COM Ports detected on the system will be stored here
myPort = IO.Ports.SerialPort.GetPortNames() ‘Get all com ports available

That's great! thank you, I will give it a shot and let you know the outcome.
:smiley:

Hi James, thanks again for your help.
I tried the code and there are no errors, just a new operator. I placed it under a button but don't know how to associate the result with a msgbox or text box.
What should I be using?
I tried a few different things but nothing worked, but what can a person expect being green...

Best wishes,

Rob

I suggest you spend some time with Google, Visual Basic Tutorials, and maybe join a Visual Basic forum.

Getting a list of serial ports and putting them into a combo box is pretty straight forward. Heck, I gave you the google search that results in an article doing just that. (it's the first link)