background image

Page: 69/81 User Manual PSU-CTRL-2D, Rev.1-00: Software Interface 

COM_HVPSU2D_MAX_CONFIG-1

 (see the declaration file 

 

COM-HVPSU2D.h

). 

Note that the call to the function 

COM_HVPSU2D_SaveCurrentConfig

 overwrites the previously 

saved configuration data without any warning. 

Any configuration stored in the NVM can be restored, i.e. 

 

loaded as the current device configuration by the function 

COM_HVPSU2D_LoadCurrentConfig

The direct command (

J

NN

©

) contains two hexadecimal digits (

NN

) for 

the variable 

ConfigNumber

. If the command is executed success-

fully, the device responds by repeating the command characters. 

Function COM_HVPSU2D_LoadCurrentConfig 

int COM_HVPSU2D_LoadCurrentConfig 

(WORD PortNumber, unsigned ConfigNumber); 

Command: j

NN

©

 

Response: j

NN

©

 

Loads the current device configuration from the configuration in the 
NVM with the number given by the variable 

ConfigNumber

 and re-

turns an error code according to Tab. 10. 

There must be a saved configuration in the NVM from a prior call to 
the function 

COM_HVPSU2D_SaveCurrentConfig

, otherwise the call 

to the function 

COM_HVPSU2D_LoadCurrentConfig

 fails

For more details, see function 

COM_HVPSU2D_SaveCurrentConfig

The direct command (

j

NN

©

) contains two hexadecimal digits (

NN

) for 

the variable 

ConfigNumber

. If the command is executed success-

fully, the device responds by repeating the command characters. 

 

CGC Instruments

 

Tel.:  +49 (371) 355 098–55 

Hübschmannstr. 18 | D–09112 Chemnitz 

Fax: +49 (371) 355 098–60

internet: www.cgc-instruments.com 
e–mail: [email protected] 

Summary of Contents for PSU-CTRL-2D

Page 1: ...le Power Supply Units Firmware Version 1 00 User Manual Document version 2 created on Oct 15 2021 CGC Instruments Tel 49 371 355 098 55 H bschmannstr 18 D 09112 Chemnitz Fax 49 371 355 098 60 internet...

Page 2: ...d Restoring the Data 34 Utility FlashLoader 35 Driver Installation 38 Installation of the Virtual Port for the USB Interface 38 Software Interface 39 Functionality of the Software Interface 39 Direct...

Page 3: ...ction COM_HVPSU2D_SetPSUOutputVoltage 61 Function COM_HVPSU2D_GetPSUSetOutputVoltage 61 Function COM_HVPSU2D_GetPSUOutputCurrent 62 Function COM_HVPSU2D_SetPSUOutputCurrent 63 Function COM_HVPSU2D_Get...

Page 4: ...U2D_GetProductNo 76 Function COM_HVPSU2D_GetProductID 77 Function COM_HVPSU2D_GetUptime 77 Function COM_HVPSU2D_GetTotalTime 78 Function COM_HVPSU2D_GetCPUData 78 Function COM_HVPSU2D_Restart 79 Error...

Page 5: ...ure List Fig 1 Block diagram of the device 9 Fig 2 Device control logic 13 CGC Instruments Tel 49 371 355 098 55 H bschmannstr 18 D 09112 Chemnitz Fax 49 371 355 098 60 internet www cgc instruments co...

Page 6: ...SU2D Control Controller settings 26 Tab 6 Displayed names of the control and status bits 27 Tab 7 Command line parameters of the program COM HVPSU2D Control Configuration management 30 Tab 7 continued...

Page 7: ...VPSU2D Control COM HVPSU2D Control is a Windows program that runs in text mode It enables you to control and monitor the pulse controller man age its configurations and backup and restore its data Exe...

Page 8: ...commands in batch files for repeated usage Tables 2 9 summarize all allowable command line parameters of the utility COM HVPSU2D Control Besides the parameters the tables also list the functions of t...

Page 9: ...Esc Numerical integer values can be specified either in decimal code or in hexadecimal or binary ones when characters h or b are appended This implies that for example 16 10h or 10000b all specify the...

Page 10: ...includes the parameter t the program termi nates without processing any following parameters If you do not specify the parameter t at all the program does not stop and enters the interactive mode aft...

Page 11: ...e uptime see functions COM_HVPSU2D_GetUptime and COM_HVPSU2D_GetTotalTime U get the device uptime periodically c get the CPU data see function COM_HVPSU2D_GetCPUData C get the CPU data periodically h...

Page 12: ...original state can be restored Since the back up and restore procedures transfer a large amount of data it is recommended to increase the communication speed by specifying the parameter see section Ge...

Page 13: ...and FlashLoader 6 Firmware txt v where Firmware txt is the file containing the current firmware and the number 6 indicates the port COM6 to which the device is con nected The program should produce th...

Page 14: ...r way to stop the flash loader on the device and resume normal operation be sure to exactly follow the instructions in this section If the verification has succeeded you may start the firmware upgrade...

Page 15: ...ry to repro gram the file Firmware txt If the error persists contact the manufacturer Attention You must not power down the device if the firmware up grade has not succeeded Otherwise the device will...

Page 16: ...the device manager by opening the set tings of the device USB Serial Port COMx To modify the settings administrative rights are required The settings are applied immedi ately you do not need to reboot...

Page 17: ...y controls up to 16 communication channels for the data transfer to and from the device see the constant COM_HVPSU2D_MAX_PORT in the declaration file COM HVPSU2D h This means it can control up to 16 d...

Page 18: ...within only 0 1 0 2 ms In contrast to that a typical USB transmission may take up to 50 ms This means that usually only less than 10 bidirectional transfers per second can be achieved when USB is used...

Page 19: ...r messages or with estab lishing the communication please contact the manufacturer of the de vice Direct Command Control As an alternative direct control by a terminal program or another software is p...

Page 20: ...ort to clear the input device buffer see section Functionality of the Software Interface and function COM_HVPSU2D_Purge before reattempting the operation The clear ing procedure should start with deas...

Page 21: ...e declaration of a particular function Note that several functions like COM_HVPSU2D_Open or COM_HVPSU2D_Close do not send any data to the device and thus do not have any equivalent direct control comm...

Page 22: ...ort control lines could not be set 6 Error reading the port status lines The port status lines could not be read 7 Error sending command 8 Error sending data 9 Error sending termination character The...

Page 23: ...ice state could not be set to not ready The device did not react properly Try to reset the communication or restart the device by powering it off and on 400 Error opening the file for debugging output...

Page 24: ...em could not issue a break with the proper timing 7 Cannot place the transmission line in a break state The system could not issue a break Check the data sheet of the used communication port 8 Cannot...

Page 25: ...port The system could not set the state of the port control lines 15 Error reading the status lines of the port The system could not get the state of the port status lines 16 Device is busy The system...

Page 26: ...ers that are supported by the operating sys tem i e any port between COM1 and COM255 can be used for the communication You must call the function COM_HVPSU2D_Open prior to any other communication func...

Page 27: ...o longer possible call the func tion COM_HVPSU2D_Purge in order to reset the communication speed to the default value of 9600 baud You can also interrupt the commu nication this deactivates the handsh...

Page 28: ...ure that the input data buffer contains enough free space If the return value of the variable Empty is false the input buffer is not empty and there is no guarantee that the device will be able to rec...

Page 29: ...the device does not respond properly the function COM_HVPSU2D_DevicePurge should be called repeatedly until it re turns the value true in the variable Empty The response to the direct command z contai...

Page 30: ...function of the power supply units The response to the direct command l contains two Boolean characters OB for the variables ConOut and ConBNC respectively Function COM_HVPSU2D_SetInterlockEnable int...

Page 31: ...s SSSS for the variable State Function COM_HVPSU2D_GetDeviceState int COM_HVPSU2D_GetDeviceState WORD PortNumber DWORD DeviceState Command S Response SDDDDDDDD Saves the detailed state of the device i...

Page 32: ...iable VoltRect is the rectified voltage supplied by the mains transformer Its value changes with changing mains voltage but the controller works properly as long as it is larger than about 6 V The res...

Page 33: ...direct command T contains 4 hexadecimal digits for each sensor temperature AAAA ZZZZ For the tempera ture units see the function COM_HVPSU2D_GetHousekeeping Function COM_HVPSU2D_GetLEDData int COM_HVP...

Page 34: ...ectly by calling the functions COM_HVPSU2D_SetPSUEnable bits ST_PSU0_ENB_CTRL and ST_PSU1_ENB_CTRL COM_HVPSU2D_SetPSUFullRange bits ST_PSU0_FULL_CTRL and ST_PSU1_FULL_CTRL and COM_HVPSU2D_SetInterlock...

Page 35: ...ST_PSU_ENB_CTRL control enable PSUs 11 12 ST_ILIM_ACT state of inrush current limiter 13 ST_PSU0_FULL_ACT state of full range of PSU 0 14 ST_PSU1_FULL_ACT state of full range of PSU 1 15 ST_RES_N stat...

Page 36: ...SU1 respectively Function COM_HVPSU2D_SetPSUEnable int COM_HVPSU2D_SetPSUEnable WORD PortNumber BOOL PSU0 BOOL PSU1 Command eBB Response eBB Sets the enable flags of the PSU modules to the values give...

Page 37: ...r contains two Boolean characters BB for the variables PSU0 and PSU1 respectively Function COM_HVPSU2D_GetPSUFullRange int COM_HVPSU2D_GetPSUFullRange WORD PortNumber BOOL PSU0 BOOL PSU1 Command p Res...

Page 38: ...ORD PortNumber unsigned PSU double Voltage Command On Response OnVVVVV Saves the output voltage of the PSU module with the number PSU in the variable Voltage and returns an error code according to Tab...

Page 39: ...r the variable PSU followed by 5 hexadecimal digits for the variable Voltage VVVVV The voltage value is in mV for the parameter unit conversion see function COM_HVPSU2D_GetPSUOutputVoltage If the comm...

Page 40: ...see function COM_HVPSU2D_GetPSUOutputVoltage Function COM_HVPSU2D_GetPSUOutputCurrent int COM_HVPSU2D_GetPSUOutputCurrent WORD PortNumber unsigned PSU double Current Command In Response InIIIIII Save...

Page 41: ...on see function COM_HVPSU2D_GetPSUOutputCurrent If the command is exe cuted successfully the device responds by repeating the command characters Function COM_HVPSU2D_GetPSUSetOutputCurrent int COM_HVP...

Page 42: ...s the measured values of the PSU module with the number PSU in the variables Voltage Current and VoltDropout and returns an error code according to Tab 10 The variable PSU is the number of the PSU mod...

Page 43: ...ber of the PSU module for more details see function COM_HVPSU2D_GetPSUOutputVoltage The return values in the variables Volt24Vp Volt12Vp Volt12Vn and VoltRef are voltages in V The first three values a...

Page 44: ...y voltage ALDO and 1 8 V for the digital core supply voltage DLDO The value in the variable VoltRef is the internal reference voltage of the ADC its nominal value is 2 5 V The return value in the vari...

Page 45: ...e is stored in the NVM and is re stored during startup This means that if the device is enabled it will be enabled at power on and will produce output voltages The response to the direct command E con...

Page 46: ...SU2D_GetPSUFullRange and disables the interlock loops see function COM_HVPSU2D_GetInterlockEnable It is recommended to call this function before setting up a new con figuration If the direct command i...

Page 47: ...SU2D_LoadCurrentConfig WORD PortNumber unsigned ConfigNumber Command jNN Response jNN Loads the current device configuration from the configuration in the NVM with the number given by the variable Con...

Page 48: ...e is a null terminated character string To generate this string format allocate the variable Name with one additional character and set the value of the last character of the array to 0 after calling...

Page 49: ...ly the device responds by repeating the command characters Function COM_HVPSU2D_GetConfigFlags int COM_HVPSU2D_GetConfigFlags WORD PortNumber unsigned ConfigNumber bool Active bool Valid Command XNN R...

Page 50: ...F for the configuration flags The configuration flags are a bit array the least significant bit bit 0 corresponds to the variable Active and the next bit bit 1 to the variable Valid This means that a...

Page 51: ...ion COM_HVPSU2D_GetConfigFlags This would take a long time especially with devices using a USB interface with a long latency The response to the direct command W contains COM_HVPSU2D_MAX_CONFIG 2 4 he...

Page 52: ...check the change list provided by the manufacturer There is no guarantee that a library COM HVPSU2D dll with different version numbers can be used with out any changes In most cases the user software...

Page 53: ...are The response to the direct command v contains 4 hexadecimal digits VVVV for the variable Version Function COM_HVPSU2D_GetFWVersion int COM_HVPSU2D_GetFWVersion WORD PortNumber WORD Version Command...

Page 54: ...e The buffer passed to the function must be created before the function call it must be at least 16 bytes long The response to the direct command D usually contains 11 charac ters dd d for the variabl...

Page 55: ...mber DWORD Seconds WORD Milliseconds DWORD Optime Command U Response USSSSSSSSMMOOOOOOOO Saves the device uptime in the variables Seconds and Millisec onds and the operating time in the variable Optim...

Page 56: ...me since the device has been manufac tured The response to the direct command u contains 8 hexadecimal digits UUUUUUUU for the variable Uptime and 8 hexadecimal digits OOOOOOOO for the variable Optime...

Page 57: ...nction COM_HVPSU2D_Restart int COM_HVPSU2D_Restart WORD PortNumber Command Response Restarts the device and returns an error code according to Tab 10 The function issues a reboot of the device s CPU a...

Page 58: ...cording to Tab 10 This function does not have any influence on the communication and can be called at any time Function COM_HVPSU2D_GetIOState int COM_HVPSU2D_GetIOState WORD PortNumber Returns the in...

Page 59: ...rface This function does not have any influence on the communication and can be called at any time CGC Instruments Tel 49 371 355 098 55 H bschmannstr 18 D 09112 Chemnitz Fax 49 371 355 098 60 interne...

Reviews: