??? 06/05/07 19:11 Read: times |
#140295 - Re: Help Responding to: ???'s previous message |
Juan Carlos said:
Jon I need help trying to display this string on a Visual Basic label using 8051 serial UART:
printf ("This table shows all data collected in one dayn"); Does printf work in VB? That's C isn't it? I am using your code sample as much as possible. If I remove these lines from your sample code: If newChar = Chr(13) Then // n end of line Me.Print "" 'skip a line Else NewChar = NewChar & MSComm1.Input End If Then my message on the label looks imcomplete like this: all data collected in one day // incomplete message On the other hand I do not see anything or nothing is displayed on the label form when executed like this, which is most of your sample code. 'setup comm object ' Fire Rx Event Every 1 Byte MSComm1.RThreshold = 1 ' When Inputting Data, Input 2 Bytes at a time MSComm1.InputLen = 1 ' 9600 Baud, No Parity, 8 Data Bits, 1 Stop Bit MSComm1.Settings = "9600,N,8,1" ' Disable DTR MSComm1.DTREnable = False 'MSComm1.InputMode = comInputModeText //*****NOTICE THIS IS OUT ' Open COM1 MSComm1.CommPort = 1 MSComm1.PortOpen = True Receiving is done with a routine like this. End of the transmission is a carriage return. Public Sub MSComm1_OnComm() Dim newChar As String Select Case MSComm1.CommEvent Case comEvReceive newChar = MSComm1.Input If newChar = Chr(13) Then // n end of line lblData.Caption = CStr(NewChar) Me.Print "" 'skip a line Else NewChar = NewChar & MSComm1.Input End If ' process other events here End Select End Sub What do I need in order to display the whole string with out errors and what if I wanted to display more messages? Thank you In my original code snippet rxbuffer was publicly dimensioned as a string. This string was the concatenation of each new char received upto a carriage return. Once the carriage return is received then use the string to change the label caption. I would add each new string to a textbox maybe instead of a label or to a disk file. I really need more information on what you want the end result to be. Also, what kind of values are you sending from the micro? Hex or ASCII or ... ? They should be ASCII and put the input mode line back in. You should send the information out of the serial port like you would send it to a LCD with the addition of the CR. Maybe ZIP up your VB project and email it to me via my profile. Unless it's other than VB6. Jon If I have a little time I'll try to put something workable together. |
Topic | Author | Date |
LPC9XX Data Logger | 01/01/70 00:00 | |
UART | 01/01/70 00:00 | |
That is it | 01/01/70 00:00 | |
Plenty | 01/01/70 00:00 | |
Windows XP | 01/01/70 00:00 | |
Off-topic | 01/01/70 00:00 | |
UART to RS232 | 01/01/70 00:00 | |
MAX-232 | 01/01/70 00:00 | |
UART to RS232 | 01/01/70 00:00 | |
BEWARE | 01/01/70 00:00 | |
MAX3222 | 01/01/70 00:00 | |
well, it does say 3V3 | 01/01/70 00:00 | |
Simple Test Solution | 01/01/70 00:00 | |
Microsoft is great | 01/01/70 00:00 | |
Mistake RS232 Levels? | 01/01/70 00:00 | |
RE: Mistake | 01/01/70 00:00 | |
Need Help | 01/01/70 00:00 | |
Hello, World! | 01/01/70 00:00 | |
start this way | 01/01/70 00:00 | |
EPM900? | 01/01/70 00:00 | |
Yes Andy | 01/01/70 00:00 | |
BABYSTEPS | 01/01/70 00:00 | |
No Good | 01/01/70 00:00 | |
read "the bible" | 01/01/70 00:00 | |
Double Check | 01/01/70 00:00 | |
It's Working!!! | 01/01/70 00:00 | |
Save to Hard Drive | 01/01/70 00:00 | |
What software? | 01/01/70 00:00 | |
back at the top of the thread | 01/01/70 00:00 | |
Keil uV3 | 01/01/70 00:00 | |
I forgot | 01/01/70 00:00 | |
Actually | 01/01/70 00:00 | |
Please do | 01/01/70 00:00 | |
Need Help Jon | 01/01/70 00:00 | |
Re: Help | 01/01/70 00:00 | |
Good! | 01/01/70 00:00 | |
Re:Good | 01/01/70 00:00 | |
Sample | 01/01/70 00:00 | |
Thank you | 01/01/70 00:00 | |
Comments | 01/01/70 00:00 | |
VB.NET | 01/01/70 00:00 | |
serial and parallel ports using VB.NET | 01/01/70 00:00 | |
Hard Drive Path | 01/01/70 00:00 | |
Drive Path | 01/01/70 00:00 | |
Delay | 01/01/70 00:00 | |
Timer | 01/01/70 00:00 | |
Yes | 01/01/70 00:00 | |
VB Ready | 01/01/70 00:00 | |
No, | 01/01/70 00:00 | |
Did it work in Hyperterminal? | 01/01/70 00:00 | |
It did | 01/01/70 00:00 | |
I changed your code. | 01/01/70 00:00 | |
Here | 01/01/70 00:00 | |
One more thing | 01/01/70 00:00 | |
Caused by LF | 01/01/70 00:00 | |
What else? | 01/01/70 00:00 | |
You could... | 01/01/70 00:00 | |
Wha? | 01/01/70 00:00 | |
Actually, I should have said putc | 01/01/70 00:00 | |
Look at ... | 01/01/70 00:00 | |
I've got it | 01/01/70 00:00 | |
Cooool | 01/01/70 00:00 | |
One more thing | 01/01/70 00:00 | |
Icon | 01/01/70 00:00 | |
Yes | 01/01/70 00:00 | |
"Caption" | 01/01/70 00:00 | |
Sample Code Updated | 01/01/70 00:00 | |
Decimal Data | 01/01/70 00:00 | |
What happens if... | 01/01/70 00:00 | |
It works | 01/01/70 00:00 | |
The reason... | 01/01/70 00:00 | |
Yes | 01/01/70 00:00 | |
Same position | 01/01/70 00:00 | |
Oops - small error | 01/01/70 00:00 | |
Yes | 01/01/70 00:00 | |
Maybe | 01/01/70 00:00 | |
Yes | 01/01/70 00:00 | |
Does not work | 01/01/70 00:00 | |
You have to... | 01/01/70 00:00 | |
Where? | 01/01/70 00:00 | |
Neither | 01/01/70 00:00 | |
Sorry, but no | 01/01/70 00:00 | |
It should have | 01/01/70 00:00 | |
Reason it didn\'t work | 01/01/70 00:00 | |
I wouldn't put it anywhere there. | 01/01/70 00:00 | |
That's OK | 01/01/70 00:00 | |
Yes it did | 01/01/70 00:00 | |
Just add this | 01/01/70 00:00 | |
I will | 01/01/70 00:00 | |
Send it all together... | 01/01/70 00:00 | |
If values have different place limits... | 01/01/70 00:00 | |
I think so | 01/01/70 00:00 | |
Excellent | 01/01/70 00:00 | |
Data Format | 01/01/70 00:00 | |
Some ways | 01/01/70 00:00 | |
Worng Link | 01/01/70 00:00 | |
Yes, wrong link | 01/01/70 00:00 | |
Replace() | 01/01/70 00:00 | |
CT needed | 01/01/70 00:00 | |
Juan, start new subject, please | 01/01/70 00:00 | |
and define your abbreviations![]() | 01/01/70 00:00 |