Hello guys,
I'm working on an existing program written in VBA and I need to make some modifications...

I have to send a command to a power supply for getting the answer of the actual status.
There is a specific format. I have modified the sending command routine in this way (using mscomm1):

Dim buffer (3) as byte

buffer(0) = &HAA
buffer(1) = &H1
buffer(2) ) &H26

mscomm1.output = buffer

Here the command works perfectly.
Then I have to get the answer from the serial port. When I read the serial port using a special com-debug program, I see that the serial port asnwers the following:

AA 01 26 04 00 00 00 00 2B (which represents the correct answer).

When I try to use the mscomm1.input command I only see the first AA (170 decimal) character.

I have used the following code:

dim stringa () as byte

stringa = mscomm1.input
lght_stringa = Ubound(stringa)
for i = 0 to lght_stringa
txt = txt & stringa(i)
next i

I have tried to change my code in many ways(changing the input mode from char to binary, using .inputlen property, I also tried to execute the .input command more than one time) but it looks that I have not formatted correctly the input. I believe I have to receive the data in the correct format and only then try to read the signle byte...but how to do?
Any help?
by the way..actually it works on VBA but if necessary I can switch to VB6...
thank you very much for any suggestion...
Carlo