r/visualbasic • • Sep 26 '18

VB 5.0 modern equivalent?

I help manage a number of machines in a manufacturing plant that use VB 5.0 for the user interface and some basic PLC communications. As I'm sure you can imagine, our computers are old. So, I'm trying to sort out what we need to get the system updated. Are there any drop-in programs that will work with a modern computer and read the code as originally written? Or is VB 5.0 so out-dated that the whole thing will either need to be heavily modified or completely rewritten?

I was thinking I'd bring in some Raspberry Pi's and throw on whatever software is needed to run the code and leave it at that. That said, I'm not that knowledgeable of computers and am open to suggestions. Thanks in advance!

5 Upvotes

10 comments sorted by

5

u/ViperSRT3g Application Specialist Sep 26 '18

"Simplest" update I can think of would be to update the machines running the apps, and use a VM to host the older OS and the PLC apps. Otherwise you'll need to contact the manufacturer of the PLC applications to see what they offer with updated software, and updating older versions.

1

u/AberrantCheese Sep 27 '18

I've spent a lot of time in this arena. Your solution is the quickest/best for OP. Virtualize the existing OS/setup with all of its custom PLC drivers, etc and run that in VirtualBox/VMWare workstation on new hardware until such time that a complete re-write can be done. The only exception would be if the custom PLC's require some custom hardware not supported by virtualization.

I would recommend that OP re-write the code from scratch in .Net using the original 5.0 only as a general template/guideline as to what needs to be done. The coding practices from the 5.0/6.0 to now so incredibly different as to make salvaging that old code a bigger headache than just starting fresh.

Source: Been there, done that

1

u/[deleted] Oct 15 '18

Curious how long a rewrite might take someone who is well versed. I am not a software guy, so I don't believe it cost effective to be that person. However, I could see it worth hiring someone for a quick job if they could do it in short order. I'd have to do research just to set-up the VM, and at that point that might be the cost of someone who knows what they're doing going through our relatively simple code (it's not very long).

2

u/AnonymooseRedditor Sep 26 '18

I have some experience in this space. The problem I think you will find isn't so much getting the software to run on modern hardware, it is the interface to the PLC / industrial equipment. I had one piece of machinery that had 2 full length 16bit ISA cards that required a special motherboard to be able to upgrade the machine.

1

u/[deleted] Oct 15 '18

Good advise, thanks! Pretty sure it was a standard ethernet/RS-232 connection, but I'll need to crack open the machine to double-check.

6

u/JakDrako Sep 26 '18

VB5 an VB6 programs still run fine (mostly, I'm sure some exotic OCXs might be problematic) on modern PCs running Windows 10. Windows has a rather formidable 32-bit emulation layer (Windows on Windows, or "WOW") that lets you run old 32-bit apps pretty mich transparently. The only thing is that the OCXs and DLLs required by the app have to be installed and registered in the \SysWOW folder. Similarly, if you need ODBC configuration, you have to use the ODBCAD32.EXE that resides in the \SysWOW folder, as the one in System32 is 64 bit (yes, it's confusing...)

Source: Maintain half a dozen VB6 apps for my employer. They've run on every Windows version since Win 2000 (XP, Vista, Win7, Win8 (ugh) and Win10...)

1

u/1point44mb_is_fine Sep 27 '18

I've dealt with this - if I didn't have the code for the original system I turned the (in this case) the Win95 machine into a VM and it's been running fine for an extremely long time. Things I had source code for I just re-wrote in C#. If you're dependent on an old OCX for this or that maybe there's a new version available from the vendor.

1

u/[deleted] Oct 15 '18

I'll have to dig some more, I'm not sure what this program uses. I know the code uses Microsoft Access - is that what you're referring to? I'm a complete noob and just trying to sort together a recommendation for how to move forward.

2

u/1point44mb_is_fine Oct 15 '18

I'd suggest that (although I like the idea) that the Pi's are out if you have to use MSAccess. If it's using RS232 or RS485 or whatever then yeah download the free P2V (Physical to Virtual) converter from VMWare and then you can use VMWare or VirtualBox to give it a try - doesn't cost you anything other then a few hours to see if it will work :-)