LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

rs 232 device data reading limits keithley 2400 IV with labwindows

Thanks Snowman, problem solved. Smiley Happy

0 Kudos
Message 21 of 25
(2,160 Views)

rakinroll,

 

Can you post your solution or at least a link to whatever drivers /code you used to solve your issue? If other folks are browsing the thread with the same questions they can probably use the same solution as you. Thanks very much!

Douglas Sappet
Test Hardware Development Engineer
Allegro Microsystems Inc.
Manchester, NH
0 Kudos
Message 22 of 25
(2,151 Views)

Ok,

 

i downloaded http://www.keithley.com/support/data?asset=16504 and http://joule.ni.com/nidu/cds/view/p/id/1196/lang/en softwares. I closed my firewall and opened Com1 for communicate with device. Parity was odd at first but i could not communicate with the device. Then i changed it to none for both of program and the device and it worked. Now i am trying to build some interfaces to control the device.

0 Kudos
Message 23 of 25
(2,140 Views)

Hi!

 

Following C codes are the basic functions you need to write commands and read data from Keithley 2400 through RS-232 port.

There's no driver needed to be installed or download.  But be sure to use a straight through RS-232 cable as stated in the manual of Keithley 2400.

 

 

 

// ===========================================================================

#include <ansi_c.h>
#include <rs232.h>
#include <cvirte.h>    
#include <userint.h>
#include <utility.h>
#include <formatio.h>           /* must be after including windows.h */

 

 

int OpenKE2400(void)
{
   char message[50];
   unsigned int dev_status;
  
   dev_status = OpenComConfig (1, "COM1", 9600, 0, 8, 1, 512, 512);    // open and configure Com1 port
  
   if ( dev_status != 0 )
   {
      Fmt (message, "%s<Keithley 2400 Source Meter is not ready!");
      MessagePopup ("Device Error", message);
      return -1;
   }
   else
   {  
    return SUCCESSFUL;
   }

}

 

 

 

char str_buffer[120], set_state_cmd[50];
double IV[5];

 

Fmt(set_state_cmd, "%s<:READ?\n");
ComWrt (1, set_state_cmd, strlen(set_state_cmd));  // command KE2400 to take a measurement
ComRdTerm (1, str_buffer, 99, 10);                          // read results from source meter
Scan(str_buffer, "%s>%s[dt#]%5f[x]", &IV);             // save results in an double array

 

//=================================================================================

Message 24 of 25
(2,100 Views)

Excellent! Thank you very much dcl9000.

0 Kudos
Message 25 of 25
(2,094 Views)