![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| Visual Basic Discuss Visual Basic programing. |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
| RS232 communications with VB6 Looking for a jumpstart to create a "simple" VB program to send and receive G- code files, (from a PC to a CNC machine). Any help would be appreciated. Thanks |
|
#2
| |||
| |||
| To Nickz, I think you will be better using a PIC on board the CNC if using RS232. Have a look for Milinst (I think it's www.milinst.com,just go to the download area) They have a CNC kit there (not very good) but you can download some VB and PIC source which will get you started... regards 1234marko |
|
#3
| |||
| |||
| VB -> RS-232 Hi I think there is a good example of serial communication in the vb examples folder, I belive it's called vbterm which is a simple terminal program. I can also recommend the book, The complete serial port by Mr. Jan Axelson, it is awsome and contains a ton of examples. That was my two cents on the subject... |
|
#4
| ||||
| ||||
The VBterm is a good place to start but does not cover some of the things you'll need for this type of RS232 communications. In it's very simplest form, you could use something like what I've done inside a Microsoft Access database... Code: Private Sub cmdSend_Click()
Dim strNCLink As String
Me.txtCustomer.SetFocus
strNCLink = "C:\Foldername\" & Me.txtCustomer.Text & "\" & Me.NCName
On Error GoTo Hell
Open strNCLink For Input As #1
MSComm1.InputLen = 0
MSComm1.PortOpen = True
Do While Not EOF(1)
Line Input #1, Rec
CharSent = CharSent + Len(Rec)
MSComm1.Output = Rec & vbCrLf
lblBytes.Caption = CharSent & " bytes"
DoEvents
Loop
Hell:
On Error Resume Next
Close
MSComm1.PortOpen = False
MsgBox "Oh, crap. Something bad just happened...", vbCritical, "Error Hit While Transferring"
End Sub
__________________ Matt San Diego, Ca ___ o o o_ [l_,[_____], l---L - □lllllll□- ( )_) ( )_)--)_) (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
|
#5
| |||
| |||
| thanks guys, I appreciate the feedback. |
| Sponsored Links |
|
#6
| ||||
| ||||
| I was given the attached VB files in response to a similar question. The code is standard VB, but the comments are in French. Still, a good tutorial! |
|
#7
| |||
| |||
| The only problem with the Comm Control is the fact that it only supports up to Port 16... while this is OK for most things, if you ever want to use it in a modern serial hub, you're outta luck. I'm not sure what the solution is to that...
__________________ http://smackaay.com Visit my site |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |