08-17-2010 11:11 AM
Thanks Snowman, problem solved. ![]()
08-17-2010 01:59 PM
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!
08-17-2010 05:42 PM
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.
08-19-2010 01:24 PM
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
//=================================================================================
08-19-2010 04:48 PM
Excellent! Thank you very much dcl9000.