02-17-2009 04:29 AM
Solved! Go to Solution.
02-17-2009 05:44 AM
Hi,
First: Are you sure that you serial communication work? Did you try HyperTerminal on Serial port?
Second: How long is delay on device between receiving command and sending response to host PC? Are you waiting to this response? 🙂
02-17-2009 06:33 AM
Not hyperterminal, but other programs, and I am pretty sure it works.
Delay on device? Are you asking about the hardware or the program? The program has no delay functions.
02-17-2009 09:08 AM
I made a new version of the read case. The old version was a while loop, the new version is a while loop which will go on until it encounters an EOF character. In this case it is
0xC1 or 'Á'. I thought the old version would break before getting any message. This doesnt get any signal either. I have probed it, and it doesn't get a string from which to take the length.
02-17-2009 09:20 AM
02-17-2009 09:26 AM
When you send command to external device ... device must processing this command and after transmit response. And there is same delay.
When you are reading from port, first try how many bytes are ready on port for reading.
02-18-2009 03:18 AM
02-18-2009 03:24 AM
02-18-2009 04:22 AM
How look like you response package? Are there same BOF and EOF bytes on begin and end? Because after is better do something like:
- Open Com port (set speed, ..., set size of IO buffers)
- Flush IO buffers
No when you have loop with transmitting and receiving do something like:
- Flush IO buffers (befor you send commend)
- Send your command to device
- Read response. But you are looking for BOF and you are reading everything to EOF
- and now you have complete response package - and no you could parse this response.
If value of EOF could be include inside between BOF and EOF is better when you disable Termination Character
02-18-2009 04:49 AM
I don't really think it is a problem, but how do you flush the I/O-buffer? Is it done automatically when you open a VISA-session?
The BOF-character is 0xC0 and the EOF-charcter is 0xC1. These characters are guaranteed not to occur within a frame through a system of escape characters.
I've made some sniffs of this communication before, and sometimes you can see a couple of zeroes between the end of a frame and the beginning of another. I suppose this does not represent an actual transmission of zeroes but rather the "sampling" of a silent serial port.