Atten PPS3005 Computer Interface - Page 1
Forum section: electronics / testgear

author: sacherjj
author_rank: Frequent Contributor
timestamp: August 21, 2013, 01:27:52 pm
content: I recently acquired an RS232 board for my Atten PPS3005 power supply. I purchased it from an ebay vendor that is selling the PPS3005 with a serial board. (I have pictures of this board and will be posting with a schematic.) Once I installed this board, I noticed the PPS3005 software download now 404s.JSnyder had a copy on his local hard drive and uploaded it for me. If you want a copy of this software, grab it:http://www.mediafire.com/download/i33tyc072aw5u81/PPS3005S_.rarIt is a piece of junk. It looks like a hack that a decent .NET programmer would throw together at lunch. I decompiled the .NET into C# and there are just so many issues. But, it gives me some insight into the serial data sent to the power supply.If your power supply is on COM1, it might actually work for you. If not, well...this.serialPort = new SerialPort("com1", 9600, Parity.Mark, 8, StopBits.One);...not so much. Most USB to Serial are up in the COM12-15 range, so the original software won't work for me.I'm writing a quick and hacked together Python script using pySerial to get the data formats correct. I could change current and voltage using Korad format, but couldn't get output enable. (If you manually enable output, it will disable.) I'm going to use this thread as a working log of messing with this power supply.Here is what I learned from the source: Serial Package is 24 bytes long.Byte 0 - 0x34Byte 1 - 0x20, 0x21, 0x22 (programPower.command) Not sure what the values represent yet, but these three values are used. See 0x20 hard coded in this program, but case statements to handle all 3. Hmm...Byte 2,3 - Voltage 1 as Volts * 100.Byte 2 - Voltage >> 8 (MSB)Byte 3 - Voltage % 256 (LSB)Byte 4,5 - Current as mAByte 4 - Current >> 8 (MSB)Byte 5 - Current % 256 (LSB)--- These are not on PPS3005, but will be applicable to multiple output Atten PPS supplies)Byte 6 - Voltage 2 MSBByte 7 - Voltage 2 LSBByte 8 - Current 2 MSBByte 9 - Current 2 LSBByte 10 - Voltage 3 MSBByte 11 - Voltage 3 LSBByte 12 - Current 3 MSBByte 13 - Current 3 LSB--- Resume PPS3005 relevanceByte 14 - powerControl = 1 (Looks hard coded, but might do things for other codes...)Byte 15 - Output Enable - Ch1 bit 1 set, Ch2 bit 2 set, Ch3 bit 3 set.Byte 16 - 1Byte 17 - language - English 0, Chinese 1 (Not sure why this is sent to the PS, are numbers different in Chinese?)Byte 18 - Over Current Shutdown - 1, Constant Current Output - 0Byte 19 - joinMode: zhengchang = 0, chuanlian = 1, binglian = 2, duichen = 3 (Got no clue on this one...)Byte 20-22 - Not specified in code, so empty value in byte array (0)Byte 23 - Checksum. LSB of sum of all previous bytes.I'm going to work today with Python and this new found info to see what I can do.

author: sacherjj
author_rank: Frequent Contributor
timestamp: August 21, 2013, 03:47:59 pm
content: Pictures of the board are here:http://imgur.com/a/tS4bOSchematic from pictures I put together:C7 should be C6 in the schematic above. Forgot to change that.

author: sacherjj
author_rank: Frequent Contributor
timestamp: August 21, 2013, 04:39:18 pm
content: This requires pySerial Python Package, and it only testing on Windows with Python 2.7 But it works. I'll be making something prettier. I'm wanting to script a multi hour discharge curve for measurement.import serialser = serial.Serial('COM15', 9600, timeout=1, bytesize=8, parity='N', stopbits=1)print ser.isOpen()voltage = 498 # Volts * 100current = 400 # in mAdata = [0xAA, 0x20, voltage >> 8, voltage % 256, current >> 8, current % 256, 0, 0, 0, 0, 0, 0, 0, 0]data.append(1) # powerControldata.append(1) # output enabledata.append(1) # hardcodeddata.append(0) # language 0=englishdata.append(0) # 0-constant current, 1-over current shutdowndata.append(0) # join mode?data.append(0) # ?data.append(0) # ?data.append(0) # ?sum = 0for by in data:sum += bysum %= 256data.append(sum)#print databyte_str = "".join(map(chr, data))ser.write(byte_str)data_out = map(ord,ser.read())#print data_outser.close()You can find out your port in Python with:import serial.tools.list_portsfor ports in serial.tools.list_ports.comports():print ports

author: arthur92710
author_rank: Newbie
timestamp: August 30, 2014, 07:50:28 pm
content: Thanks for posting this info. Just tried the Atten software and it crashes after a few mins. I'll try to program my own control software.