From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to set parameters on XDL35-5P

I am using a Sorenson XDL35-5P with CVI and IVI drivers through TCPIP connection.


I can connect and query the instrument just fine so communication is working.


I am unable to set ANY parameters. It either gives me errors through the driver or runs and returns status=0 but does not change the instrument. If I access through the webpage of the device it all works fine.


Not sure what I am missing.

 

Thanks

void main()
{

ViRsrc AG34972_VISA_Name_1 = "TCPIP0::172.16.12.248::inst0::INSTR";
ViRsrc PSU_VISA_Name_1 = "TCPIP0::192.168.1.138::inst0::INSTR";
ViStatus status;
ViChar buffer[1024] = "";
ViUInt32 retCount;
ViInt32 Hours,Mins;
ViReal64 Seconds;
ViInt32 n=0;
double Resistance;
double Voltage=12;
double Current;
ViBoolean Status = VI_FALSE;
char Error[256] = "";
ViChar Version[256];
ViChar Message[256];

status = viOpenDefaultRM(&defaultRM);

// status = viOpen(defaultRM,AG34972_VISA_Name_1,VI_NULL, VI_NULL,&AG34972_handle);
status = viOpen(defaultRM,PSU_VISA_Name_1,VI_NULL,VI_NULL,&PSU_Handle);


// status = Ag34970_init (AG34972_VISA_Name_1, VI_TRUE, VI_TRUE, &AG34972_handle);



// status = Ag34970_SystemGetSystemTime(AG34972_handle,&Hours,&Mins,&Seconds);

// status = Ag34970_RouteSetClose(AG34972_handle,301,Status);

// status = Ag34970_MeasureDCVoltMeasure(AG34972_handle,"301",100,-103,1,Voltage,n);


// status = Ag34970_MeasureResistanceMeasure(AG34972_handle,"301",-105,-103,1,&Resistance,&n);

// status = TQLP_InitWithOptions(PSU_VISA_Name_1,VI_TRUE,VI_TRUE,"Simulate=0,RangeCheck=1,QueryInstrStatus=1,Cache=1",PSU_Handle);

status = TQLP_init(PSU_VISA_Name_1,VI_TRUE,VI_TRUE,&PSU_Handle);
// status = TQLP_ResetWithDefaults(PSU_Handle);
// status = TQLP_SetAttributeViInt32(PSU_Handle,"1","RANGE",1);
// status = TQLP_SetAttributeViReal64(PSU_Handle,"1",TQLP_ATTR_VOLTAGE_LEVEL,10.0);


status = viWrite(PSU_Handle,"V1 14",6,VI_NULL);
TQLP_error_message(PSU_Handle,status,&Error);

// status = TQLP_ConfigureVoltageLevel(PSU_Handle,"1",Voltage);
// status = TQLP_ClearStatus(PSU_Handle);
// TQLP_SetAttributeViReal64(PSU_Handle,"1", TQLP_ATTR_RANGE_SETTING,1);
// TQLP_SetAttributeViReal64(PSU_Handle,"1", TQLP_ATTR_VOLTAGE_LEVEL,12.0);
// status = TQLP_ConfigureOutputRange (PSU_Handle, "1",TQLP_VAL_RANGE_VOLTAGE, 12.0);
// status = TQLP_error_message(PSU_Handle,status,&Error);



// status = TQLP_ConfigureVoltageLevel(PSU_Handle,"1",(ViReal64) 24.0);
// TQLP_ConfigureCurrentLimit(;
// status = TQLP_ConfigureOutputEnabled(PSU_Handle,"1",VI_TRUE);
status = TQLP_error_message(PSU_Handle,status,&Error);



TQLP_close(PSU_Handle);


// Ag34970_close(AG34972_handle);

}

0 Kudos
Message 1 of 3
(4,494 Views)

sthompson134,

 

what drivers do you have installed, and what errors do you see? 

0 Kudos
Message 2 of 3
(4,449 Views)

I finally figured it out. It was an issue of me not thinking clearly and not completely reading the manual. The issue I had was I was using the TCPIP0::ip address::inst0::INSTR VISA handle. It works great with an XDL35-5P supply for querying etc. It however DOES NOT work for any program control. You have to use the TCPIP-::ip address::9221::SOCKET name instead. Clearly tells you this in the manual if you read it closely. Apparently I was brain dead when doing this.

 

I did find out that the drivers do not like the Sorensen brand. Had to update TQLP.c for the names and set the attributes for the termination character.


Thanks

Shawn

0 Kudos
Message 3 of 3
(4,445 Views)