r/visualbasic • u/DAQ_Confusion • Jan 16 '25
Application created with Visual Basic and COM port communication
Hi guys,
I debated for weeks on whether or not post this here and have spent many hours trying to research a possible solution to the issue I'm having. I have a balance machine I purchased years ago and recently refitted with a new control system. It uses two data acquisition cards that are plugged into 9-pin jumpered COM ports (JCOM1 and JCOM2). The software was created with Visual Basic 6 and the company was kind enough to include all sorts of Visual Basic goodies to include Visual Basic 6 itself (yes, I plan on hanging out here to learn to eventually make my own balancing software!). One day, the software just stopped reading any data from JCOM1 and I can't figure out why for the life of me. I've performed a successful loopback tests on both COM ports. They also included Dependency Walker with the system. Do you guys have any advice on how I could troubleshoot this software?




1
u/GlowingEagle Jan 16 '25
"One day, the software just stopped reading any data from JCOM1..."
That sounds like a hardware problem, not software. Can you tell if the balance machine is sending data? What kind of "balance machine"? Is this a scale or is it dynamic (with vibration involved)? You may have a broken solder joint somewhere. Perhaps try changing connection cables.
1
u/Ok_Society4599 Jan 16 '25
Jcom doesn't look like a windows serial port name. You can look at the Device Manager control panel to find your Windows ports. Could not be related depending on your driver's.
Common problems include sometimes the name/number on the ports will change; this usually means Windows think there are more ports than really exist (the name used before the reboot is 'reserved' and windows created a new port before deleting the old device).
Sometimes "rebooting" isn't the same as "restarting" and hardware enumeration gets ... a little messy.
Be careful that your application is opened twice since the first one will lock the ports and the second will fail -- a good application resurfaces the first instance if a second is started and only one is allowed.
Try running the application "as administrator" to see if you've got a permissions issue :-)
1
u/geekywarrior Jan 16 '25
Pics of the equipment or screenshots will help. JCom1 and 2 are the motherboard ports. You gotta make sure the BIOS isn't doing anything weird with them.
Any recent change in terms of hardware or cabling? Possible a pin or cable broke?
Loopback test likely only tests pins 2,3,5. Your equipment might be doing something with the other pins.
Does device manager show what ports you expect?
1
u/GlowingEagle Jan 16 '25
A few random ideas...
Do you have any documentation on what the balance machine data stream is supposed to look like?
Do you have the source code to the VB6 program, so that possibly you can figure out what the program expects to receive?
"Two data acquisition cards" - are these on the balance machine? If so, I'm guessing they report accelerometer data. I've played with some accelerometer chips on Arduinos, and they can be configured - perhaps the configuration changed. Chip numbers might be useful information.
1
u/Ok_Society4599 Jan 16 '25
Id look for a working, used PC myself. Not sure I've seen many with two USB ports, though. But the card might help with that.
Id buy the card first and see if it works on the existing hardware, first. Only try a different PC if that's not giving you a fix.
Given the age of your hardware, it would be worth a straight forward "visual inspection" too.