my GUI using VB6.0 had 2 textbox to allow user enter an integer that represent a movement of motor along X and Y axes. there is any possible that i can send 2 data simultenously? do i need a delay? for your information, i used serial port. thank you VB genius. a feedback is really appreciated!

If I understand your question properly, you are asking if two numbers can be sent at the same time to a device connected to your serial port. If so, the answer is it depends on the device. Serial ports transmit a bit of data at a time, but blocks of data can be transmitted in a session. It depends on what the receiving device expects to receive. Some devices take a commands as MOV 23,56\n. This would tell it to move 23 counts in the X Axis and 56 counts in the Y axis. \n represents the end of message.

Let me know if this helps.

that problem had been solved. this is my source code for two interger. but i had i problem. how do i make my GUI talk with PIC 16f877? there is any source code that make VB6.0 talk with the PIC circuit?

Private Sub Form_Load()
Dim Xvalue As Long
Dim Yvalue As Long

For Xvalue = 0 To 15
    cboXvalue.AddItem CStr(Xvalue)
Next Xvalue


cboXvalue.ListIndex = 0

For Yvalue = 0 To 15
    cboYvalue.AddItem CStr(Yvalue)
Next Yvalue


cboYvalue.ListIndex = 0

MSComm1.CommPort = 1


MSComm1.Settings = "9600,N,8,1"


MSComm1.DTREnable = False


MSComm1.PortOpen = True

End Sub

Private Sub cmdSend_Click()
Dim Xvalue As Long
Dim Yvalue As Long


Xvalue = cboXvalue.ListIndex
Yvalue = cboYvalue.ListIndex


MSComm1.Output = Chr$(255) & Chr$(Xvalue) & Chr$(Yvalue)

End Sub
Private Sub Form_Unload(Cancel As Integer)
MSComm1.PortOpen = False
End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.