CPC Utility under Windows

From LEXWiKi

Revision as of 19:35, 2 April 2012 by Sylviachang (Talk | contribs)
Jump to: navigation, search

Contents

LAN By Pass Utility Download

Binary file:CPC_Utility_v1.0w_Bin(32bit).rar CPC_Utility_v1.0w_Bin(64bit).zip
Source file:CPC_Utility_v1.0w_Src(32bit).rar CPC_Utility_v1.0w_src(64bit).zip


How to Use The Utility

CPC Utility Main Window

Image:CPC_Utility.png
1: Setting Button, press this button will open "Setting Window".
2: Battery Setting Button, press this button will open "Battery Setting Window".
* Kindly notice that you have to set I2C Address in setting window before open battery setting window.
3: Recently Voltage Value, utility will detect the recent voltage value and show in the edit box, when start to monitor.
4: Period Voltage Value, utility will detect the period voltage value when "start under low voltage detect". If "under low voltage detect" doesn't operate, period voltage value will be hide.
5: Operation Mode
6: Battery Type, if disable "under low voltage detect", battery type will be hide.
7: Start Button, press this button will start to monitor and show battery infomation on utility main window.
* Kindly notice that you have to set I2C Address and Recently Battery Value Check Frequency in setting window before starting to monitor.

CPC Utility Setting Window

Image:CPC_Setting1.png

1: I2C Address
2: Submit Button, press this button when finish selecting I2C address, then CPC Basic Setting section and CPC Monitor Setting section will be enable to set(like the picture below).


Image:CPC_Setting2.png
3: Delay Main Power On
4: OS Delay Off
5: Main Power Delay
6: Load Default Button
7: Read Register Button, press this button will read the value from register.
8: Set Button, press this button to set when finish selecting what you want to set in CPC basic setting section.


Image:CPC_Setting3.png
9:
10:
11:
12:
13:


CPC Utility Battery Setting Window

Image:CPC_Battery1.png
1: Disable Under Low Voltage Detect
2: Battery Type
3: Submit Button


Image:CPC_Battery2.png
4: Battery Low Voltage
5: ACC Active
6: Under Low Voltage Warning
7: Read Register Button
8: Confirm Button
9: Cancel Button


Introdution(Part of Setting)

Setting Main Power On

void SettingPowerOn(BYTE SlavAddr,BYTE bValue)
{
	bValue=OptionToASCII(bValue)+1;   //remove the option of A(option number used ascii code A~Z)
	WriteI2CByte(SlavAddr,0x12,bValue);
}

Setting OS Delay Off

void SettingOSDelayOff(BYTE SlavAddr,BYTE bValue)
{
	if(bValue==17)
		bValue=90;   //option of "infinite", have to write ascii code "Z" to register
	else
		bValue=OptionToASCII(bValue)+1;   //remove the option of A
	WriteI2CByte(SlavAddr,0x15,bValue);
}

Setting Power Off

void SettingPowerOff(BYTE SlavAddr,BYTE bValue)
{
	bValue=OptionToASCII(bValue)+1;   //remove the option of A
	WriteI2CByte(SlavAddr,0x17,bValue);
}

Setting Low Voltage Level

void SettingLowVoltage(BYTE SlavAddr,BYTE bValue)
{
	bValue=OptionToASCII(bValue);
	WriteI2CByte(SlavAddr,0x19,bValue);
}

Setting Battery Type

void SettingBatteryType(BYTE SlavAddr,BYTE bBatteryType)
{
	bBatteryType=(bBatteryType)?Battery_24V:Battery_12V;
	WriteI2CByte(SlavAddr,0x1A,bBatteryType);
}

Setting Low Voltage Detect

void SettingLowVoltDetect(BYTE SlavAddr,BYTE bAccStatus)
{
	bAccStatus=(bAccStatus)?ACC_High:ACC_Low;
	WriteI2CByte(SlavAddr,0x1B,bAccStatus);
}


Introdution(Part of Read)

Convert Voltage

void VoltageConvert(float &Voltage)
{
	Voltage=Voltage*4/1023*3.3*10;
}

Read Power On

int ReadPowerOn(BYTE SlavAddr)
{
	int Data;

	Data=ReadI2CByte(SlavAddr,0x12);
	Data=ASCIIToOption(Data)-1;   //remove the option of A(option number used ascii code A~Z)

	return Data;
}

Read OS Delay Off

int ReadOSDelayOff(BYTE SlavAddr)
{
	int Data;

	Data=ReadI2CByte(SlavAddr,0x15);
	Data=ASCIIToOption(Data)-1;   //remove the option of A

	return Data;
}

Read Power Off

int ReadPowerOff(BYTE SlavAddr)
{
	int Data;

	Data=ReadI2CByte(SlavAddr,0x17);
	Data=ASCIIToOption(Data)-1;   //remove the option of A

	return Data;
}

Read Low Voltage

int ReadLowVoltage(BYTE SlavAddr)
{
	int Data;

	Data=ReadI2CByte(SlavAddr,0x19);
	Data=ASCIIToOption(Data);

	return Data;
}

Read Battery Type

int ReadBatteryType(BYTE SlavAddr)
{
	int iBatteryType;

	iBatteryType=ReadI2CByte(SlavAddr,0x1A);
	switch(iBatteryType)
	{
		case Battery_12V:
		{
			iBatteryType=0;
			break;
		}
		case Battery_24V:
		{
			iBatteryType=1;
			break;
		}
		default:
		{
			iBatteryType=-1;
			break;
		}
	}

	return iBatteryType;
}

ReadLowVoltDetectTiming

int ReadLowVoltDetectTiming(BYTE SlavAddr)
{
	int iAccStatus;

	iAccStatus=ReadI2CByte(SlavAddr,0x1B);
	iAccStatus=(iAccStatus==ACC_Low)?0:1;

	return iAccStatus;
}

Read Instant AD Value

float ReadInstantADValue(BYTE SlavAddr)
{
	float Data;

	Data=(float)ReadI2CByte(SlavAddr,0x30);
	VoltageConvert(Data);

	return Data;
}

Read Period AD Value

float ReadPeriodADValue(BYTE SlavAddr)
{
	float Data;

	Data=(float)ReadI2CByte(SlavAddr,0x31);
	VoltageConvert(Data);

	return Data;
}

ReadOperationMode

BYTE ReadOperationMode(BYTE SlavAddr)   //ReadDIP_SWSetting bit1
{
	BYTE Data;

	Data=ReadI2CByte(SlavAddr,0x32);
	Data=(Data>>1) & 0x01;

	return Data;
}

Read ACC Status

BYTE ReadAccStatus(BYTE SlavAddr)   //ReadDIP_SWSetting bit4
{
	BYTE Data;

	Data=ReadI2CByte(SlavAddr,0x32);
	Data=(Data>>4) & 0x01;

	return Data;
}
Personal tools