Need some help on VB....
Discussion in "Software" started by Saurabh9118 Mar 7, 2010.
Sun Mar 07 2010, 12:46 pm
can anybody suggest me how to interface hyper terminal to VB?
actually i m controlling four stepper motors through PC.... i need to send commands to uC 8051 :
@APC***- for Auto mode Previous Channel(motor),
@ANC***- for Auto mode Next Channel(motor) etc.....
i did all the programming in C for that... but i want to add a command button instead of wrinting these commands in hyper terminal... how can i do that?
actually i m controlling four stepper motors through PC.... i need to send commands to uC 8051 :
@APC***- for Auto mode Previous Channel(motor),
@ANC***- for Auto mode Next Channel(motor) etc.....
i did all the programming in C for that... but i want to add a command button instead of wrinting these commands in hyper terminal... how can i do that?
[ Edited Sun Mar 07 2010, 12:49 pm ]
Sun Mar 07 2010, 05:48 pm
use c# and drag and drop Text box and also drag and drop button too double click draged button and write
this will send the command written in text box
SerialPort.Write(TextBox1.Text);
this will send the command written in text box
[ Edited Sun Mar 07 2010, 05:49 pm ]
Saurabh9118 like this.
Mon Mar 08 2010, 04:06 pm
go through these two post..
http://www.8051projects.net/_serial_programming_VB
http://www.8051projects.net/_serial_communication_with_VB_software
http://www.8051projects.net/_serial_programming_VB
http://www.8051projects.net/_serial_communication_with_VB_software
Saurabh9118 like this.
Mon Mar 08 2010, 10:27 pm
Thanx...guys...
I vl submit my project very soon... this is a wonderful site...it helped me a lot in overcoming each difficulty... Special thanx 2 Ajay sir.
I vl submit my project very soon... this is a wonderful site...it helped me a lot in overcoming each difficulty... Special thanx 2 Ajay sir.
Wed Mar 10 2010, 04:46 pm
I hav one query: (refer first post for commands)
I m using hyper terminal in my project for controlling these motors & it shows as below
auto mode channel 1.... after some delay... auto mode channel 2
But now i want to do same thing in VB...i did some part lik i can giv command in VB but i m nt able to
check it like dat of hyper terminal as shown in fig.... can u please tell me how can i get same thing in
VB text box?
how can i display same things as in hyper terminal in text1 box.....?
I m using hyper terminal in my project for controlling these motors & it shows as below
auto mode channel 1.... after some delay... auto mode channel 2
But now i want to do same thing in VB...i did some part lik i can giv command in VB but i m nt able to
check it like dat of hyper terminal as shown in fig.... can u please tell me how can i get same thing in
VB text box?
Private Sub Command1_Click() MSComm1.Output = "@ANC***" End Sub Private Sub Command2_Click() MSComm1.Output = "@APC***" End Sub Private Sub Command3_Click() End End Sub Private Sub Form_Load() MSComm1.CommPort = 1 'Define COM port available on PC MSComm1.Settings = "9600, N, 8, 1" '9600 Baudrate, No Parity, 8 bits data, 1 Stopbit. MSComm1.InputLen = 1 'Read 1 character/byte whenever Input property is used. MSComm1.InputMode = comInputModeBinary 'Input will retrieve data in array of bytes. MSComm1.PortOpen = True 'Open Serial Port COM1. End Sub Private Sub MSComm1_OnComm() End Sub Private Sub Text1_Change() End Sub
how can i display same things as in hyper terminal in text1 box.....?
[ Edited Wed Mar 10 2010, 11:24 pm ]
Thu Mar 11 2010, 01:47 am
whatever you receive on serial port.. add it to text box
text1.text = "Text to display in text box" 'to update text box Text1.text = Text1.text & "New Text"
Powered by e107 Forum System