01-12-2012 03:27 PM
Timeout expires waiting for a reponse from operations that require me to enter an expected response or a format string for the response content (ie ID Query, Error Query, Revision Query).
The tests for which I don't enter an expected response string seem to work fine.. I'd like help figuring out the correct format strings for the others.
I tried using the VISA Test Panel for the serial device in Measurement & Automation Explorer (MAX). I found the apropriate termination character is \r (carriage return). I was able to communicate with the device smoothly while in MAX. For example, if I send *00id and click on "Query", the response is an expected ?00ID=90. If I click on "Write" and then on "Read", I get the same result.
Back in IVI Instrument Driver Wizard, clicking on "Run Tests..." before generating the driver produces the following:
Test Results
=====
Serial Port Configuration
...Passed
VISA Initialization
Return Code : 0x0 (Operation completed successfully.)
Default Command
Return Code : 0x0 (Operation completed successfully.)
Bytes Sent : 12
ID Query
Return Code : 0xBFFF0015 (Timeout expired before operation completed.)
Reset
Return Code : 0x0 (Operation completed successfully.)
Bytes Sent : 12
Error Query
Return Code : 0xBFFF0015 (Timeout expired before operation completed.)
Revision Query
Return Code : 0xBFFF0015 (Timeout expired before operation completed.)
=====
Right now the command-response pairs are set up like this
ID query
*00id
Expected ID Query Response
"?00ID-90"
Error query command
*00rs
Format String
%256[^\r]
Revision command
*00v=
Format String
\"%256[^\"]
Return code 0x0 is expected when there are no errors in the command.
Port settings in all evironments match, icluding read/write terminators.
Any help help figuring out the correct format strings is appreciated!
01-16-2012 12:41 AM
Hello ObiCaban,
Exactly, which serial device are you attempting to communicate with and generate a CVI IVI driver for? Do you have a link to its manual you could provide?
01-16-2012 07:23 AM
I can't provide a manual because the serial device is company hardware. Is there anything in particular you'd like me to check in the manual?
01-16-2012 09:55 AM - edited 01-16-2012 09:56 AM
Hello ObiCaban,
The manual should contain a list of the low level commands that the serial device will respond to as well as a format for each of the typical responses. I've attached a tutorial to guide you and explain this further once you've had a chance to review the manual.
Creating IVI Driver Files with the Instrument Driver Development Wizard
http://zone.ni.com/devzone/cda/tut/p/id/10098
01-16-2012 01:29 PM
Shawn,
I've been through the tutorial and have been able to create a driver for a GPIB device before. No problems with the wizard then. In this case I'm having problems with a serial driver.
After various attempts, I got the results summarized in my first post. I need help understanding the format strings and what/how they should be written to get correct responses. Using other interfaces I'm able to communicate with the device flawlessly.
All seems to work fine except the format strings of the expected responses within the wizard.
My most recent attempt to solve this is to "reverse engineer" the correct format string by looking at the output of the wizard after ignoring the erroneous Test Results.
Thanks for your time!
01-16-2012 06:36 PM
Hello ObiCaban,
I just found that this is a known issue. Coorective Action Report (CAR) # 2CME63AW talks about this behavior. Its work around is to ignore the VISA error and use the driver generated. However, make sure the information provided to the wizard is correct.