TTi Class

Syntax

tti_CPX400* tti_device=new tti_CPX400(port);

Description

Creates an object which allows you to communicate with your TTi CPX400 power supply. It has several methods to get and set values.

- "port" must be an serial port on your computer.

- It has the following methods for setting values:

int enable(int channel);

//enables output <channel>

int disable(int channel);

//disables output <channel>

int setStatus(int channel, bool on_off);

//set output <channel> on/off where <on_off> has the following meaning: 0=OFF, 1=ON

int setVoltage(int channel,double Voltage);

//Set output <channel> to <Voltage> Volts

int setOverVoltageProtection(int channel, double voltage);

//Set output <channel> over voltage protection trip point to <voltage> Volts

int setCurrent(int channel,double current);

// Set output <channel> current limit to <current> Amps

int setOverCurrentProtection(int channel,double current);

//Set output <channel> over current protection trip point to <current> Amps

int setDeltaVoltage(int channel,double voltage);

//Set the output <channel> voltage step size to <voltage> Volts

- It has the following methods to get values:

double getVoltage(int Channel);

/*Returns the set voltage of output <Channel> The response is Voltages in volt as double /

double getActualVoltage(int channel);

/*Returns the output readback voltage for output <channel> The response is voltage in volt as double*/

double getCurrent(int channel);

/*Returns the set current limit of output <channel> The response is current in Ampere as double */

double getActualCurrent(int channel);

/

double getOverVoltageProtection(int channel);

/*Returns the voltage trip setting for output <channel> The response is Voltage in volt as double */

double getOverCurrentProtection(int channel);

/*Returns the current trip setting for output <channel> The response current in amps as double */

bool getStatus(int channel);

/*Returns output <channel> on/off status. The response is status as bool where 1 (true) = ON, and 0 (false) = OFF. */

string getID(void);

/*Returns the instrument identification. The exact response is determined by the instrument configuration and is of the form <NAME>,<model>,<Serial No.>, <version><rmt> where <NAME> is the manufacturer's name, <model> defines the type of instrument, Serial No. is the unique serial number and <version> is the revision level of the software installed. The format of <version> is X.xx – Y.yy where X.xx is the revision of the main instrument firmware and Y.yy is the revision of the Interface board firmware. The Interface firmware is field updateable by the user via the USB port.*/

int getSerialNumber(void);

// returns the serial number of the device

string getSerialNumber_str(void);

// returns the serial number of the device as string

string getAddress(void);

/*Returns the bus address of the instrument; This is the address used by GPIB, if fitted, or may be used as a general identifier over the other interfaces.*/

- It emits the following signals:

"ActualVoltageCh1(double)"

"ActualVoltageCh2(double)"

"ActualCurrentCh1(double)"

"ActualCurrentCh2(double)"

Examples

- Creating an object in compiled code. For this you have to add the DLL to either the folder of the executable or put it in a folder which is part of the path. Then as usual add the header file and the "LIB" file to your project. Since It is using parts of the ROOT framework your project has to know them as well. Make sure you have the correct DLL for your ROOT version.

- If you want to use the DLL with ROOT make sure you have the correct version. The command to load the DLL is:

gSystem->Load("SCom_VXpX_ROOT_5-XX.dll");
where X is a number indicating the version.

From here on both versions behave the same. Next step is to create an object of the tti_CPX400 class.

int main(int argc, char *argv)

{

tti_CPX400

receiver_class s3(); // creates an receiving class

s2->startThread(); // starts a thread that will emit the actual voltage and actual current

s2->setVoltage(0,5); // sets the voltage of both channels to 5V

s2->connect(SActualVoltageCh1,"reciever_class",%s3,"testSignal1(int)");

// using enumerated Signals is only possible in compiled code

// in ROOT use

//"s2->connect("ActualVoltageCh1(double)","reciever_class",%s3,"testSignal1(int)");"

for (int i =1;i<20;++i)

{

Sleep(5000);

s2->samplingTime =100*i; // changes the sampling rate in which the //thread emits the voltage and current it cannot be smaller than 1000 ms. The //sampling time is in milliseconds.

}

return 0;

}

Topic attachments
I Attachment History Action Size Date Who Comment
Dynamic Linked Library; Microsoft application filedll SCom_V1p1_ROOT_5-28.dll r1 manage 134.5 K 2012-09-21 - 11:02 RichardPeschke Serial communication class
Unknown file formatlib SCom_V1p1_ROOT_5-28.lib r1 manage 33.8 K 2012-09-21 - 11:02 RichardPeschke Serial communication class
Dynamic Linked Library; Microsoft application filedll SCom_V1p1_ROOT_5-30.dll r1 manage 134.0 K 2012-09-21 - 11:02 RichardPeschke Serial communication class
Unknown file formatlib SCom_V1p1_ROOT_5-30.lib r1 manage 33.8 K 2012-09-21 - 11:02 RichardPeschke Serial communication class
Dynamic Linked Library; Microsoft application filedll SCom_V1p1_ROOT_5-32.dll r1 manage 134.5 K 2012-09-21 - 11:02 RichardPeschke Serial communication class
Unknown file formatlib SCom_V1p1_ROOT_5-32.lib r1 manage 33.8 K 2012-09-21 - 11:02 RichardPeschke Serial communication class
Dynamic Linked Library; Microsoft application filedll SCom_V1p1_ROOT_5-34.dll r1 manage 134.5 K 2012-09-21 - 11:02 RichardPeschke Serial communication class
Unknown file formatlib SCom_V1p1_ROOT_5-34.lib r1 manage 33.8 K 2012-09-21 - 11:02 RichardPeschke Serial communication class
C source code filecpp SerialCom.cpp r1 manage 14.0 K 2012-09-21 - 11:04 RichardPeschke  
Header fileh SerialCom.h r1 manage 2.6 K 2012-09-21 - 11:03 RichardPeschke source files
C source code filecpp chiller_new.cpp r1 manage 4.8 K 2012-09-21 - 11:03 RichardPeschke source files
Header fileh chiller_new.h r1 manage 1.4 K 2012-09-21 - 11:04 RichardPeschke  
C source code filecpp tti_new.cpp r1 manage 18.5 K 2012-09-21 - 11:03 RichardPeschke source files
Header fileh tti_new.h r1 manage 6.8 K 2012-09-21 - 11:03 RichardPeschke source files
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r3 - 2020-08-31 - TWikiAdminUser
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox/SandboxArchive All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback