Total Format - Total Entertainment
 
 

Go Back   Total Format Forum > Computing Forums > General Computer Discussion

General Computer Discussion You should use this section to discuss software topics including Windows, Linux and various software applications, together with hardware related topics including buying a new machine, graphics cards, keyboards, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 12-07-2009, 21:16   #1 (permalink)
Name, Title, Location meow
Kissed all the girls

The twighlight zone
Maldives
Avatarmeow's Avatar
Mood
Posts3,205
Karma meow is amazing.
meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.
Pu6,762.47
Awards
TF Top Poster Bronze 
Total Awards: 1
Cat 3 Gift Box Medal Single Red Rose Flowers Cake French Fries litebeer Subway Apple Heart Love Hearts Cash Love Hearts Tissues

Default aaarrreeeyyyggg

from := Serial Communication with Visual Basic .NET

.............

Unfortunately Microsoft has never paid much attention to the serial port. In the Windows API it is just regarded as a file, and in the first version (1.1) of the .NET framework (managed code) there was no support for serial communication. Fortunately, a new namespace - System.IO.Ports - has been added in version 2.0, which has made things much easier although there are still some problems. For example, it is not possible to control the FIFO in the UART. It is also not possible to tell when the transmitter serial register is empty, so it is almost impossible to control the modem control signals and send a break condition, but worst of all, Microsoft has put an 8 bit wide buffer on top of the 11-bit receiver FIFO and therefore destroyed the possibility for a precise Break, 9th bit and error detection. Besides, many of the examples in the help files are directly misleading and unnecessary complicated. For example, it is recommended to use My.Computer.Ports.OpenSerialPort("COMx") to open a serial port, but if it is done that way, it is not possible to set many of the properties of the port like e.g. the length of the receive buffer and it is not possible to tell when a port is open (IsOpen).

In many developer forums there has been a lot of questions concerning serial port communication, but unless you are lucky enough to get in touch with the one, who has designed the serial port, it is usually very hard to get precise and helpful answers. For example, when we wanted to use very high speed communication (up to 921.6 Kbit/s), we only got the answer that it couldn't be done or we needed to write our own drivers! However, it is in fact possible to use System.IO.Ports even up to 921.6 Kbit/s if a UART with a 128 byte FIFO is used (16C850 or 16C950). As a service to others with the same problems as we have been through we have chosen to publish a small program, which is able to communicate through the serial port. The sample program is written in Visual Basic .NET (in the following just VB), because this language is as close as you get to our own suggestion for a simple and efficient programming language (see: Programming). In .NET there is no longer any performance difference between VB, C++ and C#.



WARNING! This description is based on VS 2005 and .NET 2.0. Unfortunately, SerialPort does not work in all versions of .Net.

To clarify the various .Net releases:

.Net 1.1 RTM = No serial port support!

.Net 2.0 RTM = First version with serial port support.

.Net 3.0 RTM = .Net 2.0 RTM + new .Net 3.0 RTM assemblies.

.Net 3.5 RTM = .Net 2.0 SP1 + .Net 3.0 SP1 + new .Net 3.5 RTM assemblies.

.Net 3.5 SP1 = .Net 2.0 SP2 + .Net 3.0 SP2 + .Net 3.5 SP1 + new .Net 3.5 SP1 assemblies.

Only a few bug fixes were made to Serial Port in .Net 2.0 SP1:


Race condition between SerialPort.Close and event loop runner shutting down Serial IO WaitCommEvent enters high CPU and leaks memory when USB Serial Port removed (Internal Regression).

SerialPort.ReadExisting() returns incorrect characters.
And only one change were made to Serial Port in .Net 2.0 SP2:

UnauthorizedAccessException in SerialStream crashes application after disconnecting device from USB COM port. This should fix the issue of the unhandled exception when disconnecting a device from a USB COM port. However, there are reports indicating that the attempt to fix the bug doesn't work.

The big problem is .Net 3.5 RTM, which includes .Net 2.0 SP1. Almost nothing in SerialPort seems to work in that version! In fact, there seems to be so many errors that .Net 3.5 RTM may be regarded as completely useless for all serial port applications! For the moment the following problems have been reported:

It may crash if you access the modem control signals while the port is receiving.
It may crash if you try to close a port set to a wrong speed - even if you have an error handler for the ErrorReceived event.
You cannot use multiple ports.
In many cases, the DataReceived event does not fire.
If you try to run a 3.5 application generated under Vista on a XP PC, it may lock up the COM ports forever making them useless for all programs including Hyperterminal - even if you delete the application again or remove the 2.0/3.5 framework. It is necessary to repair or re-install Windows to return the ports to their funtionality prior to the loading of the application!
Microsoft thinks that the many problems with serial port in .Net 3.5 RTM may be coursed by other, unrelated(!), bug fixes that went into .Net 2.0 SP1. Most of these problems seems to be fixed in .Net 3.5 SP1, but the problem is that nobody knows what coursed all the problems so nobody knows whether the problems are fixed or not! For the moment it cannot be guaranteed that 3.5 SP1 works as well as 2.0. VS 2008 allow you to select the wanted .NET version when you build your application. This is done in Advanced Compilation Options. Be sure to select either 2.0 or 3.5 SP1!
.......
oh heck lol !
meow's Sig:"Some people see things as they are and ask `Why?'. I dream of things that never were and ask `Why not?'. "
"science without religion is lame, religion without science is blind"
Toolsmeow is offline
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-07-2009, 21:43   #2 (permalink)
Name, Title, Location Detomah
Owner&Designer

Total Format HQ
United Kingdom
AvatarDetomah's Avatar
Mood
Posts22,895
Karma Detomah is a superior being.Detomah is a superior being.Detomah is a superior being.Detomah is a superior being.
Detomah is a superior being.Detomah is a superior being.Detomah is a superior being.Detomah is a superior being.Detomah is a superior being.Detomah is a superior being.Detomah is a superior being.Detomah is a superior being.Detomah is a superior being.Detomah is a superior being.Detomah is a superior being.Detomah is a superior being.Detomah is a superior being.
Pu129,376.10
Critters
Blog
Blog Entries: 2
Awards
TF Activity Award - Silver TF Activity Award - Bronze TF Gaming Award - Silver TF Top Poster Bronze TF Top Poster - Silver TF Top Poster - Gold 
Total Awards: 6
Sunderland AFC Dog 2 Pie Treasure Single Red Rose England
Default

You did? Or are scared that you will do? Or just think it's a really crap development?
Detomah's Sig:
Donations - Help Total Format, by kindly donating your spare cash.
Site Map - See exactly what Total format has to offer during your stay.
TV Guide - check out what is on TV right here at Total Format.
Cartoons - Read the latest comics that Total Format has to offer.
Search | BBCodes | Smilies | FAQs | Forum Rules | Contact TF | Link To TF | Privacy Policy
Follow Total Format on Twitter HERE
ToolsDetomah is offline
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 13-07-2009, 00:19   #3 (permalink)
Name, Title, Location meow
Kissed all the girls

The twighlight zone
Maldives
Avatarmeow's Avatar
Mood
Posts3,205
Karma meow is amazing.
meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.
Pu6,762.47
Awards
TF Top Poster Bronze 
Total Awards: 1
Cat 3 Gift Box Medal Single Red Rose Flowers Cake French Fries litebeer Subway Apple Heart Love Hearts Cash Love Hearts Tissues

Default

well my usb ports have stopped working, I use a rs232 serial connection over usb via bluetooth dongley thingy,,, but im not using vista though,,,

but i cant beleive its such a shambles all round. full of bugs, and bascialy i cant get it to work very fast for pants.
meow's Sig:"Some people see things as they are and ask `Why?'. I dream of things that never were and ask `Why not?'. "
"science without religion is lame, religion without science is blind"
Toolsmeow is offline
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 13-07-2009, 07:59   #4 (permalink)
Name, Title, Location Harv
Dr Slice n Dice M.s.C.

in bath wiv sash
United Kingdom
AvatarHarv's Avatar
Mood
Posts4,276
Karma Harv is outstanding.Harv is outstanding.Harv is outstanding.
Harv is outstanding.Harv is outstanding.Harv is outstanding.
Pu14,763.12
Critters
Blog
Blog Entries: 10
Awards
TF Top Poster Bronze 
Total Awards: 1
Heart Big Beer Umbrella Sunderland AFC Gift Box Cat 2
Default

so thats why there is no hyperterminal in vista or windows7 did wonder why they dropped that seemingly useless app (to non literate people) and one of the most useful for those who work with networks.

They probably couldn't get it to work with the serial port stuff ><
ToolsHarv is offline
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 13-07-2009, 16:40   #5 (permalink)
Name, Title, Location Mars
Freak 100%

Lancashire
United Kingdom
AvatarMars's Avatar
Mood
Posts1,946
Karma Mars is advanced.Mars is advanced.Mars is advanced.
Mars is advanced.Mars is advanced.Mars is advanced.Mars is advanced.Mars is advanced.Mars is advanced.Mars is advanced.Mars is advanced.Mars is advanced.Mars is advanced.Mars is advanced.Mars is advanced.Mars is advanced.Mars is advanced.Mars is advanced.
Pu23,026.36
Beer Big Beer Glass of Wine litebeer Champagne Birthday Cake
Default

why would anyone want to use the serial port for anything anyway? they are
completely legacy, having been superceded by usb, firewire, bluetooth yada yada...
ToolsMars is offline
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links

Old 14-07-2009, 00:36   #6 (permalink)
Name, Title, Location meow
Kissed all the girls

The twighlight zone
Maldives
Avatarmeow's Avatar
Mood
Posts3,205
Karma meow is amazing.
meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.meow is amazing.
Pu6,762.47
Awards
TF Top Poster Bronze 
Total Awards: 1
Cat 3 Gift Box Medal Single Red Rose Flowers Cake French Fries litebeer Subway Apple Heart Love Hearts Cash Love Hearts Tissues

Default

usb is just a glorified serial port,,,its fast but a darn sight harder to use for most things as you have to write drivers etc, few USB devices work with anything other than the user interface they come with, exept for the simple things like usb flash sticks etc.

most new usb implementations seem to have an underlying com port - most use a chip from FDTI, FTDI Products - it makes implementing USB a piece of pie as it looke like a com port. you can have many com ports over the same USB link.

my bluetooth wireless link uses USB dongle and has an rs232 interface on the other end which connects to a microcontroller, for small devices like that USB is quit an overhead. many industrial devices still use rs232.
meow's Sig:"Some people see things as they are and ask `Why?'. I dream of things that never were and ask `Why not?'. "
"science without religion is lame, religion without science is blind"
Toolsmeow is offline
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
aaaaaarrrrreeeeeeeeyyyyyyggggggggggg, aaarrreeeyyyggg

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


 
 
Archive - RSS Feeds - About Us - Privacy - Terms of Use - Site Map - Advertising - Link To TF - Contact Us - Top
Content Relevant URLs by vBSEO 3.2.0 RC5 Copyright ©2003 - 2000, Total Format. Forums powered by vBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Limited.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393