Hello,
I'm using VISA libraries in C++ to control a GPIB device and two RS-232 Devices.
The GPIB DAQ unit and RS-232 power supply are working great. My issue is with an RS-232 Microcontroller Programmer.
I'm using a Serial PSoC Programmer by Arista Systems.
Using this code:
viQueryf( psoc, "%s", "%t", "v\r", myIn); //request version
I can send commands and get a response all day long. The above
command "v\r" requests the firmware version from the hardware.
It's returned in the 'myIn'.
My issue is when I change the baud rate of the programmer.
I use the statement:
viQueryf( psoc, "%s", "%t", "b02\r", myInitIn); //changes baud rate to 115200
Two seconds after the baud rate is changed, the programmer responds
with an 'OK' string (or error code) sent at the NEW baud rate.
I'm having a hard time reading the return codes after changeing the baud rate.
The next command I send after changeing the baud rate fails...I assume
it's because I have not read the 'OK'string from the buffer. The
third command and everythin thereafter work great.
I've tried using viRead and viScanf to pick up the return codes after changeing the baud rate. No luck.
Also, viQueryf seems to be the only way to send and receive anything
with this device....shouldn't I be able to use viPrintf or viWrite?
I'm looking for any suggestions. btw, all the above commands work
great in a terminal program, so I know the programmer is working as
spec'd in the manuals.
I can get by without reading the return codes after changeing the baud
rate but, it would be nice to have error detection in case something is
wrong.
Thanks,
-Rocko