Avatar of AnswerTheMan

asked on 

Comunicating External hardware device

In 9 days, i have to give an answer to a FIRM if i'm willing to Upgrade a software they are using
from DOS to WIN32.
the existing software were written some years ago in C for DOS. there is no way\chance to make
the company who wrote it give me the source code, nor giving me any hints of the basic concepts
regarding anything.
i've been observing the existing software for 3 days. my impression is that i can make a better software

(WIN32) with not much effort.
however, 1 issue is totally Unknown to me, and i have no idea how to START dealing with it, since i've

never done that before.
that is the <<Comunicating between My program and an EXTERNAL hardware device>>
here is a short description :

the existing software is comunicating with External Device through COM1.
the external device is a BOX which is connected to 3 acustic sensors that record some mechanical
equipment noises. each record recorded holds 3 values from those 3 sensors.
now, the documentaion says that the BOX saves up to 100 last records.
upon starting some function in the software - the BOX is clearing all records and starts transmiting
the computer's  COM1 new records. after the protocol validate that a record has been accepted properly -

the BOX delete it.
SO, what i need is :
1. How can i implement the Command from the Softwrare to BOX to clear and start transmitting ?
2. How do i know the FORMAT i accept from COM1, so i can process it in the software ?

if i had the existing C source code - i could get it from there. since i don't - can i make it ?

unless you have complete and full positive answer - just post COMMENTS plz, otherwize - i'll have to
automatically reject in order to unlock the Q for more comments.
Thank you.

Visual Basic Classic

Avatar of undefined
Last Comment
Avatar of Erick37
Flag of United States of America image

Can you get protocol documentation for the BOX?
Avatar of AnswerTheMan


:)if i could - i would not be posting this Q....
Avatar of Erick37
Flag of United States of America image

You could use a serial tap to watch the communications flow while the program is running.  Tap the line from another PC and open HyperTerminal to view the data stream between the BOX and the other computer.  You can change the Hyperterminal settings until you figure out what the hardware settings are.  By viewing the data stream, maybe the software protocol will expose itself too.
Avatar of frankd
Flag of United States of America image

Based on what I read, the BOX sends information and you have no way of knowing what format that information is in.

If this is the case, the data will come back in one of three ways.
1.) The information will come back in some fashion that you will be able to recognize and extract the data (trial and error).
2.) The information will come back in a form that is highly encrypted and you will never understand what is what.
3.) The information will come back in a form that while not encrypted is not easy to see the data from everything else coming back.

As for having your software command the BOX to dump the data, the documentation must specify what commands are required.

After all this, it sounds like a straight forward COM1 function to send and recieve data.

The other thing that might help all the experts to give you a better answer would be the manufacturer of the BOX.

I wish I were you, this sounds like the kind of challenge I enjoy.

Good Luck

Avatar of Inspector

Use the the Microsoft Comm Control to communicate out the port to start or stop the process and to receive the infromation.
Avatar of mark2150

You need two taps. One for inbound traffic and one for outbound Your monitoring system will need both com port RX channels and neither TX channel.

Write a little program (preferably in DOS) that alternately looks to both RX ports and prints what it finds to the screen. Have it use two colors to distinguish from COM1 and COM2 data.

(I've actually done this to decode a data stream)

Then it's simply a matter of putting the existing system thru it's paces to see what the command/response sequences are. Once you know these you can easily write your VB app using the MSCOMM control to send the same sequences and expect similar responses.

Problems occur if your testing isn't complete and you don't determina *ALL* commands.

This is not conceptually hard to do (and I've done) but it can take an inordinate amount of fiddling to get it right based on empirical observations like this.

Avatar of AnswerTheMan


tnx for responses given so far.
anymore comments will be welcome.
However, as i expected, this part going to be the problematic one, since as mark2150 mentioned - i can never be sure i implemented all existing commands and functinality.

evaluating this Q will take time, since the existing system is heavily used round the clock, and if i decide to make it - i'll have to disable them of using it for my "trial and error" experiments.
if i'll make it - i will be able to evaluate your comments.
one more thing :
i'll apriciate if you'll post comments regarding other comments given. maybe this can lead for agreed first priority action that i should start with, when i'll come to that.

thanks again
Avatar of mark2150

Of course you could always demand a copy of the manuals and support documentation as a condition of taking the job...

Avatar of AnswerTheMan


hmmm... it's not that simple, M.
that firm asked the software-hardware company that built BOTH the exisiting software AND the hardware to make the upgrade + software improvments.
the PRICE that that firm demandad was much too high, so they came to me (i made for them a lot of projects before).
of course i can demand the protocol, and maybe i'll put it as a condition, but, you see, the chances to get it are poor....
the problem of not having free access to the system whenever i need - is another obstecle...
what would you do ? i don't really *NEED* that job now. i have plenty, although this one seems a fast and easy one (exept the above problem), good money, and no crucial time-limit\deadline to deliver.
Avatar of mark2150

Blurred text
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of AnswerTheMan


mark2150: yes. that's what i had in mind.
BUT, i think i'll demand another oportunity to check the system before giving ANY answer. in this oportunity - i'll try Erick37 suggestion, which is handy and won't request any special preperations from me.
IF (using the Hyperterminal) i'll get a clearer picture THEN
  i may take it straight.
  i probebly be telling them what you said.

...........thank you.
Avatar of kfrick

IF you can get your hand on and old copy of PCPlus for DOS, it does a great job of displaying the CONTROL CHARACTERS that are quite often used to signal the START and END of a message...
many devices use, for example, STX (which is Chr$(2) in VB) to signal the start of a message.
You may have to use two PC's to capture the data from each side of the conversation.......
This type of project is not impossible, but it is MUCH easier if you can spend a day or two with the equipment ;-)

Avatar of AnswerTheMan


ok. here it is :


is what i've used to get it with.
it's a good tool, and i could get about 5% of what i was after in 4 days (5 hours each day) of joining the team that works with the current system.

there are about 80 settings available from software to BOX, each of them have to tracked. i've got 4....

so - i've explained to the executives there that tracking the 95% remaining will take a LONG LONG time, when working "with" the team. since i don't work for nothing - it'll cost them less to try get the complete protocol, source code, or order a new software from the original source.

i'm waiting for their decision.
as for awarding points for this Q :

since i've never did such thing concerning hardware before - i was hoping to get a MAGIC solution, and obviously disapointed.
however - facing the materia, i know i was naive and therfore - i apreciate all comments.
Mark2150 showed the most willingness and readiness to help (byond the thecnical aspect), so, i hope nobody will gut hurt of him getting the points.
thank you all.
Avatar of mark2150

Thank you sir!

Visual Basic Classic
Visual Basic Classic

Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.

Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews


IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo