transfering data to UC00A

LED Blinking, Walking with Cytron Servo, Displaying RFID, Multi-function Mobile Robot......

transfering data to UC00A

Postby kane » Fri Oct 22, 2010 11:09 pm

hi..i'm currently having problem with transferring data to uc00A using visual basic programming...anyone hv any clue on how to do it?
kane
Freshie
 
Posts: 6
Joined: Fri Oct 22, 2010 11:05 pm

Re: transfering data to UC00A

Postby sich » Fri Oct 22, 2010 11:59 pm

UC00A will create a virtual com port in your computer. So what u need to do is to open that specific com port in order to transmit/receive data from it. To check the correct com port, just go to Control Panel > System > Device Manager. Look into the Ports (COM & LPT). You'll find a new com port listed inside there.
~> How to ask QUESTIONS the SMART way in FORUM? <~
User avatar
sich
Moderator
 
Posts: 603
Joined: Tue Apr 21, 2009 2:15 pm

Re: transfering data to UC00A

Postby kane » Sat Oct 23, 2010 1:37 pm

ohh..ok..i will try it..thx ya.. :)
kane
Freshie
 
Posts: 6
Joined: Fri Oct 22, 2010 11:05 pm

Re: transfering data to UC00A

Postby kane » Sat Oct 23, 2010 6:48 pm

erm..do u know how to access the com port in visual basic? it is a serial or parallel port? i am new to visual basic..
kane
Freshie
 
Posts: 6
Joined: Fri Oct 22, 2010 11:05 pm

Re: transfering data to UC00A

Postby sich » Sun Oct 24, 2010 3:03 am

It's serial port.
You will need to establish the port in your vb program.
CODE: SELECT_ALL_CODE
Dim WithEvents port As SerialPort = New System.IO.Ports.SerialPort("[color=#FF0000]COM1[/color]", 9600, Parity.None, 8, StopBits.One)

You may use the port like this...
CODE: SELECT_ALL_CODE
port.Open()
port.Write(txtSendText.Text & "!%")
port.Close()


MSDN has the full details about SerialPort Class. There're a lot of example available in the internet. Cytron also provides some .NET sample source code here:
1. SC16A
2. SD02B
~> How to ask QUESTIONS the SMART way in FORUM? <~
User avatar
sich
Moderator
 
Posts: 603
Joined: Tue Apr 21, 2009 2:15 pm

Re: transfering data to UC00A

Postby kane » Sun Oct 24, 2010 4:24 pm

thx ya...err the program that u write :

port.Write(txtSendText.Text & "!%")

txtSendText.Text, is it the text that i wanted to send to the port?

and what is "!%" ?
kane
Freshie
 
Posts: 6
Joined: Fri Oct 22, 2010 11:05 pm

Re: transfering data to UC00A

Postby sich » Sun Oct 24, 2010 6:16 pm

It's just an example...
Yes. That function will send string through serial port. "!%" is another string placed behind "txtSendText.Text". It can be any characters though.
There're also WriteChar & WriteByte functions if not mistaken.
U may refer to msdn for the argument to be put inside the function or just trial-n-error.
~> How to ask QUESTIONS the SMART way in FORUM? <~
User avatar
sich
Moderator
 
Posts: 603
Joined: Tue Apr 21, 2009 2:15 pm


Return to DIY Project Set

Who is online

Users browsing this forum: No registered users and 8 guests

cron