I tend to use Combo Boxes for loading the data into (I think it looks more professional and harder for users to get wrong) and sorting as below.
Visual Studio Serial Port Example Code Was AMy first piece of serial comms code was a University assignment getting two PCs, then three, then you get the idea talking on (what I now know to be) an RS422 with its pair of cables using Borlands Turbo C for DOS.Time passed I graduated (somehow) and I got to be a Design Engineer in the real world.The this was taking on a project that had been half done and then the guilty party ran.
Visual Studio Serial Port Example Professional And HarderSo to make it work the way it was wanted, out came the software (VB6) and there goes any social life I had. The area of -3v to 0 to 3v is taken as not valid to allow for noise and interference on the line. If the port is idle the port is at high level (or -12v), which is why if you look at circuit diagrams of peripherals there is always to a lot of invertors. RS-485 detailed at the end, RS-422 RS-449 and on to allow very long cable runs and high speeds all follow the same basic path. I found the only sure fire way was to poll it with a loop or timer (and possibly lock the system, bless DoEvents ) another point worth noting was the limit of 16 Serial Ports (I have used 9 on a test rig using MSComm and was getting a bit worried in case there was another set of devices) Thankfully the Net Serial Class lifted it 255. This all changed with the release of.NET1 serial comms were over looked (for reasons that were not clear, I presume it was something to do with security). This gave two ways around it this gave the option of using Dos to create and print to a (virtual) device or import the OCX (this was in the height of.NET-COM war). I did do a program for communicating to a high definition video screen using MScomm in Borland C Builder (I got it working in the end Cliff Ha) this led to a large executable so not suitable for most applications. Once.NET 2.0 was released I gave a sigh of relief as this came with a serial port class native to the frame work. I started to use C as well as VB then dropped VB6 all together. I didnt do any of this Windows malarkey until I got to the real world so forgive any stumbles I might make. An important step is to open device manager, You can find this this extremely useful tool buried in Windows Ten in the Windows Administraitive Tools, Select Computer Managment, This pops up the Computer Management Window shown below. Visual Studio Serial Port Example Install Of TheAs always a red cross or yellow triangle mean somethings up with the install of the hardware. So my two pennys worth is this is a better than a piece of software thats sits there and will do nothing. This covers all the serial ports that appear on the machine. This will create a serial port object with the following parameters as default 9600bps, no parity, one stop bit and no flow control. To this I have added the button (name Ports) and a Rich Text Box. Its uses for sorting and aligning text are considerably more than the straight textbox. For instance, Com5 and Com6 are in my phone and below is shown the Device Manager screen with the Ports COM and LPT option expanded. As can be seen the ports are not in sequential order these can be ordered.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |