Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

vb6 serial communication

Status
Not open for further replies.

lish

New Member
Hi
im doin a project which i need to transmit and receive data from vb interface. im using max232 ic and pic 16f84 and vb6.
i need a help to how to use "mscom" command?
what is the purpose of sending ASCII values?

and to start with if anyone can help me writig a simple vb code to turn on a LED by pressing a command button in VB interfac please
thank you
 
Have a look at this thread. The VB code in that thread displays any received characters. To send characters add a button and code mscomm1.output = "A" to send character A etc.

Mike.
 
Last edited:
vb communication

yeah
thanx for repling me as soon as possible.
i will try the code you send.
but i need to know that is it only possible to send ASCII charactors trough VB? can i send some control information or some number of bits directly from VB? for an example when a command button is pressed,
11001010 bits should be transmitted via serial port to the microcontroller
can this be done without sending ASCII values?
any example codes please send
thanx again
 
Just do mscomm1.output = chr(&hca). Or, mscomm1.output = chr(202)

11001010 = 202 decimal = 0xca in hexadecimal.

Mike.
 
need to connect max232 ic for a com port by using a virtual serial port driver in proteus 7. then short the Tin and Rout pins of the IC to get the sent charactor again in VB interface. seems that the max232 is not working as intended. anyone can help me with the scematic?
thanx
 
i have attached my circuit diagram here.. anythin wrong in this?
 

Attachments

  • cct.doc
    35 KB · Views: 310

Attachments

  • cct.doc
    66 KB · Views: 232
Last edited:
thanx for the reply
i have changed the wiring. but no output.
when i short the pins rxd and txd of P1, i can get the sent charactor through the VB interface. but i cant get thet when the IC is connected. is there anyrhin else wrong?
 
Last edited:
thanx for the reply
i have changed the wiring. but no output.
when i short the pins rxd and txd of P1, i can get the sent charactor through the VB interface. but i cant get thet when the IC is connected. is there anyrhin else wrong?

hi,
Do you have pin16 to +5V and pin15 to 0V.?

Measure the voltages on pin2 approx +9V,,, and pin6 approx -9V

Also is pin5 of the 9pin connector used as 0V.

Please post your new circuit.
 
Last edited:
no.
still i dont use any hardware
i wanted to simulate it on proteus with the virtual serial port emulator and VB interface. need to know why the 232 IC is not working in proteous?
thanx
 
no.
still i dont use any hardware
i wanted to simulate it on proteus with the virtual serial port emulator and VB interface. need to know why the 232 IC is not working in proteous?
thanx

Sorry, I dont use proteus.:)
 
i need to do data exchange via USART. When PIC MCU receives data, it immediately sends the same data back. If PIC is connected to the PC i can get them back via a vb interface. im using microC and use the example code given in microC. but seems not working. complilng is ok. atachted the code here. if anyqne can help me??
is there anything wrong or need to add somethin more
 

Attachments

  • 3.doc
    21.5 KB · Views: 196
hi

I m tryng to send data from VB through serial communication using MAX232 and read them in a microcontroller. sofar i could manage to send ASCII charactores through VB. I need to send binary value through VB.Lets say if i press a command button i need to send '10001110' value to the microcontroller. what are the changes that i need to make in VB. if anyone can help me please.

my VB code is below





Private Sub Form_Load()
MSComm1.Settings = "2400,N,8,1"
MSComm1.InputLen = 1
MSComm1.CommPort = 2
MSComm1.PortOpen = True
MSComm1.RThreshold = 1
End Sub



Private Sub Form_Unload(Cancel As Integer)
Close #1
End Sub



Private Sub MSComm1_OnComm()
If MSComm1.CommEvent = comEvReceive Then
txtRx.Text = txtRx.Text & MSComm1.Input
End If

End Sub



Private Sub cmdtx_Click()

MSComm1.Output = txtTx.Text (123)

End Sub
 
hi,
Look at this VB5 subr also the MSCOMM1 setup, I use this for binary i/o.
 

Attachments

  • esp01 Jun. 15.gif
    esp01 Jun. 15.gif
    10.6 KB · Views: 277
  • vb5Uart1.txt
    3.7 KB · Views: 216
  • VB5hex.txt
    1.5 KB · Views: 210
Last edited:
hi,
You may find this subr easier to follow, note the 'open as Binary'.
 

Attachments

  • VB5xmit_hex1.txt
    2.7 KB · Views: 239
slider

hi
i need to use the slider bar in VB6. i use min = 0 and max = 10. when drag the slider bar anong 0 to 10 i need different ten binary values to store in a variable.if anyone can help me what event i should use and how to use it wit a sample code
thanx
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top