Poll
Question: How to write to Arduino  (Voting closed: June 13, 2012, 02:32:35 pm)
Use Marlin/ teacup Sketch - 0 (0%)
Write your own - 2 (100%)
Total Voters: 2

Pages: [1]   Go Down
Author Topic: VB 2010 Arduino G Code  (Read 2004 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

North Queensland, Australia
Offline Offline
Edison Member
*
Karma: 70
Posts: 2176
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Gergia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 91
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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# .
Logged

Here was my old signature !!!

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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)

Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

Pages: [1]   Go Up
Jump to: