@centerbolt wrote:
Olaf,
It does sound like you are encountering a buffer overflow. Handshaking can play a part in this. I think I would start by verifying whether or not you are encountering a buffer overflow. Does the 128 bytes that you do receive look like correct data? Is your vi generating any errors?
From the image you posted, it looks like you are using some sort of handshake during the read. Is that correct? Can you post your vi's that configure the port and read the port?
By looking at the data I can see that the first 4-5 read cycles look reasonable, because the 20 byte status is sent first and looks different from the binaray data that follows. Then there are a couple - maybe 5-10 - more read cycles where data looks strange until nothing happens anymore - meaning no data seems to be received anymore. Regarding the handshaking: I have to look into this a bit more since the original code is not from me and the programmer has left our group a year ago. I will add the relevant paragraph concerning handshaking from the manual at the end of this message. It looks like our code does not do exactly what the manual says but I remember that our programmer had a hard time gettting this running at all after a lot of trial-and-error.....
The configuration is shown in the first image I sent in the last post, the vi is much larger and contains a lot of other stuff which does not modifiy the serial port (only flushing and setting a new baud rate). If it helps I can send it but I am afraid that is does not provide any more information.
The device I am trying to communicat with is an Amptek Pocket MCA (Multichannel Analyzer) which is not easy to program since communication seems to be far from any standards (as far as I can tell). I can look into that and send some more information if neccessary.
--------------------------------------------------------------------------------------------------------------------
PC enters this mode after SEND DATA COMMAND. The sequence to receive a byte is as
follows:
1. Check if there is a byte received by the serial port or if interrupts are used an interrupt is
generated when a byte has been received.
2. Get and store the byte from the serial port.
3. If the byte received is not the last expected byte from the MCA8000A alternate DTR
indicating that the PC is ready to receive data.
4. If the byte received is the last expected byte do not alternate DTR and disable interrupts in
case of interrupt transfer.
The MCA8000A always sends first the 20 bytes of the MCA8000A status structure. If
the check sum of the status bytes is OK the PC may store the status information. After the
status information has been received the MCA8000A starts sending the channel data in packets
of two bytes - the lower or the upper word (see Channel Data and Send Command). First is
send the lower byte of the channel data word. The PC can interrupt the data transfer from
MCA8000A to the PC at any time by setting the RTS line HIGH.
NOTE: MCA keeps sending data as long as PC enables the data transfer from MCA to the PC
by keeping RTS LOW and alternating the DTR signal. Therefore, it is the PC responsibility to
monitor and control the data transfer between the MCA8000A and the PC.