Saturday, March 9, 2013

From VB6 to .Net ( VB2010 )



After coding in VB6 for over 15 years, finally decided to move to VB2010.  As before, the project was already on hand and it was my last minute decision to move to .Net. I could have downloaded a trial version of VB2010 few years before and played with it, but with many different projects running simultaneously time was always short and that never happened.

I am not a pure software person, all my projects are more of hardware than software part. Software is only limited to GUI, Database, proprietary bus interface and data exchange with factory automation system.


Sponsor: www.avmicrotech.com/shop  eshop for your electronic needs


My first impression was total betrayal as I seemed to be programming in Visual C++  than VB. Common ActiveX like winsock was not available by default in Vb2010. Message read from serial port could not be written directly to Textbox.... different threads. As TCP/IP was to be used for data exchange with Host, I had to re-write the communication backbone which was not an ordinary ASCII stream but a complex system that was optimised for engineering data exchange. I had to transfer variables stored as Integer, single and double to byte stream of unsigned integer, 4byte floating point and 8 byte floating point.

But after 3 weeks of coding I was more than happy. It was very easy to come up with multi-threaded system where the data exchange with host was running independently from my user interface and background data collection part. Further all my data conversion were handled by native functions  Overall a much simpler and compact than my previous projects.

....cont

No comments:

Post a Comment