Pages: [1]   Go Down
Author Topic: Visuall Basic serial communication  (Read 765 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi!, I'm new... I would know how could be a code to receive in VB 2008 the following data throught USB (Serial) from Arduino

Serial.print('F');              
Serial.print(pulseCounter);          //  pulseCounter is an INT
Serial.print(1);  
Serial.print(1);    



I only get cut data in VB

ThankYou!!
Maxi
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 616
Posts: 49433
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I only get cut data in VB
What does this mean? What code is running on the Arduino? What VB code are you using?
Logged

0
Offline Offline
God Member
*****
Karma: 2
Posts: 596
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I only get cut data in VB

My guess is your VB code is not printing out all the characters you are expecting to see, i.e. the characters print()ed by Arduino.

I have two suggestions: first, if you haven't done it already, open up the serial terminal and look at what exactly Arduino is sending.
Next, look carefully at how you are dealing with received serial data in VB. Remember the mechanism is the same as that on Arduino: the com port delegate (i.e. serial port callback function) is called whenever there is some data for you. You almost certainly have to insert an end-of-message marker on the Arduino side, and concatenate the received bytes on the VB side until that EOM char is seen.

I hope those 4 lines make sense :-)
Logged

0
Offline Offline
God Member
*****
Karma: 2
Posts: 596
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, can't say much unless you provide the entire Arduino and VB code...
Logged

Pages: [1]   Go Up
Jump to: