LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ke2015_init throws error

Hello,
         I am using Keithley2015 to audio analysis with my application. I am using RS232 port for remote operation instead of GPIB. When I am calling ke2015_init, it causes error -101 in instrument and ke2015_init() function throws error code -1073807339(Timeout expired before operation completed). Below is the code for my initialization,
           ViSession audioHdl;
           ke2015_init("ASRL1::INSTR", VI_ON,  &audioHdl);
If I am calling, "ASRL1::INSTR" with MAX, I am able get new session and communicate.
Any help would be highly appreciated. Thanks in advance.
Best Regards,
Anurag
 
0 Kudos
Message 1 of 8
(3,392 Views)
You should check RS232 communication parameters, specifically message terminator, which are settable from your instrument's panel (choosing among line feed, carriage return or boh): they may be automatically added to messages sent via MAX but must be explicitly added to messages send via your program.


Message Edited by Roberto Bozzolo on 01-12-2008 10:52 AM


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 8
(3,386 Views)
A little update.
 
I'm intending that you are using a specific driver: it seems the init command expects an answer from the instruments which is not likely to come due to the -101 error raised, that's why the timeout error. You may look inside driver options to see if it's possible to set a specific terminator, otherwise experiment with different settings inside the instrument (usually CRLF is the most used).


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 8
(3,378 Views)
Hi,
       Thanks for your detailed answer. I have attached a spy capture when I am calling ke2015_init() function. The error is received after query for "ERROR" and "IDN".  I hope it is due to format string in driver is wrong.
       Any help to resolve the problem would be highly appreciated......
Best Regards
        Anurag  
0 Kudos
Message 4 of 8
(3,366 Views)

Hi,

From your NISpy capture, you seem to be addressing the instrument using ASRL2::INSTR, from your initial post you said you successfully addressed the instrument in MAX using ASRL1::INSTR. So why are you not using ASRL1::INSTR?

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 5 of 8
(3,345 Views)

Hate to be the bearer of bad news but this driver was never tested with RS232 (probably GPIB only). The driver is sending commands that are not terminated with linefeed. On GPIB this is ok because it has EOI but on RS232 the instrument has to know when it has successfully received a command (*idn?). It does this on serial buses like RS232 and TCPIP::SOCKET by waiting for the linefeed.

 

Where did you get the driver from? NI or Keithley?

 

 

0 Kudos
Message 6 of 8
(3,340 Views)

Hello,

         Thanks for your detailed answer. I received it from Keithley website. I couldnot find any other driver for 2015. Do I need to write my own driver for achieving this or do I go back to GPIB? Problem is driver is not sending CRLF characters at the end. I experimented with various RS232 settings with 2015.  No Use......Smiley Sad

Any help to resolve the problem is highly appreciated.

Best Regards,

Vijay

0 Kudos
Message 7 of 8
(3,308 Views)

The release notes for the Keithley Ke2015 driver says it doesn't support RS232. So you have several options:

1. Use Keithley driver with GPIB

2. Request source code form Keithley and add "\n" to all the commands in the driver. I see you have LabWindows so you can compile the source from Keithley.

3. Try the NI version of this driver. I know they used to have one. Maybe it supports RS232.

 

 

0 Kudos
Message 8 of 8
(3,298 Views)