Hi QextSerialPort developers,
I'm using QextSerialPort and SCPI (standard commands for programmable
instruments) to control a Tektronix 4050 DMM with my Qt application
"DMM_get_values". As I only have limited access to such device, I've
developed a DMM emulation software called "DMM_send_values" based on the
same code basis. I use two Prolific PL2303 compatible USB-to-serial
adapters and a null modem cable. I've recently extended the tools to
handle a variable samples count. Multiple samples are sent
comma-separated. Then, I've noticed the issue.
When using 100 samples with 10 chars each, the next command is
incomplete (only the end of the command is transfered through the wire).
This reproduces always for sure. If using more or less samples, it works
as expected. This is independent from the baud rate.
Communication is like this:
Command sent and received:
":TRIG:COUN 1;:SAMP:COUN 100;\n:SYST:ERR?\n"
Response sent and received:
"+0,\"No error\"\r\n"
Command sent and received:
"INIT;\nFETC?\n"
Response sent and received:
"-0.000200,-0.000200,-0.000200," ... "-0.000200\r\n"
Command passed to the Qesp write() function:
":STAT:QUES:EVEN?\n"
Command received:
"EN?\n" or "S:EVEN?\n"
Any idea how to fix this issue?
I use 4097 bytes as a buffer (last char is used for '\0') and read up to
4096 bytes (the size of a memory page). I do polling with 5ms cycles
with DMM_get_values and 50ms cycles with DMM_send_values. In case a
command or response isn't terminated, I concatenate the strings of two
cycles. I also have separate QStrings for send and and receive. Can't
find any issue on my side.
I use QextSerialPort from Git commit 3be3fbf31ed (Jul 8 2013) and
develop mostly on Linux. My tools are GPLv3 licensed and public. So you
could have a look at my Qt 4.7 source code:
https://github.com/sriemer/dmmctr
src/dmmcontrol.cpp/.h:
* QThread sending SCPI commands and receiving responses
src/DMM_send_values/dmmcontrol.cpp/.h:
* QThread receiving SCPI commands and sending responses
src/serialportctr.cpp/.h
* wrapper/helper class for QextSerialPort
Cheers,
Sebastian