Reading the input power of an EasyV3

Hello together,

currently I’m trying to read the input power of an EasyV3, but it’s allways 0. Here is a snipped of the code I’m using:

// Input Voltage
new TPM[TPM_Info];
PM_GetInfo(TPM);
Measurementdata_.Input_Voltage = TPM.VIn/1000.0;

// Power
Measurementdata_.Power = TPM.PIn/1000.0;

Input_Voltage and Power are both float variables.

Can somebody help me out?

Greetings
stegmaf

Hello @stegmaf,

“Pin” of “TPM_Info” indicates the power consumption at the V IN and GND terminals of the myDatalogEASY V3. I.e. the power that flows from the external source (e.g. a power supply) into the myDatalogEASY V3. In order for the myDatalogEASY V3 to absorb energy at all, the charging control must be activated by setting the charging mode (PM_SetChargingMode) and the charging condition must be met.

// Charging mode
PM_CHARGING_OFF    = 0,          // Charge control deactivated
PM_CHARGING_NORMAL = 1,          // charge, if state of charge <50%
PM_CHARGING_SOLAR  = 2,          // always charge when possible and 
                                 // sufficient input voltage (V IN > 16V ) is available 

I used the following code to test the function:

/* Cyclic 1s timer  */
#callback Timer1s()
{
	new f32:Input_Voltage;
	new f32:Power;

	new TPM[TPM_Info];
	PM_GetInfo(TPM);
	Input_Voltage = TPM.VIn/1000.0;
	Power = TPM.PIn/1000.0;
	
	#log("BatteryType %d, Flags %04x", TPM.BatteryType, TPM.Flags)
	#log("Input %f, Battery %d, Power %f, SOC %d",Input_Voltage, TPM.VBatt, Power, TPM.SOC)
	#log("Mode %d, Description %s", TPM.ChargingMode, TPM.Description)
}

main()
{
	/* Initialisation of a cyclic 1 sec. timer */
	setInterval(Timer1s, 1000);

	PM_SetChargingMode(PM_CHARGING_NORMAL);
}

Kind regards
Josef

Hello @Josef,

thanks for the fast reply, is this feature only usable, when a battery is used? Currently I’m using a PSU as supply and still don’t get any values back.

Greetings
stegmaf

Hello @stegmaf,

“Pin” of “TPM_Info” indicates the power consumption at the V IN and GND terminals, used to charge a rechargeable battery built into the PSU. If you are using a PSU without an integrated rechargeable battery (e.g. PSU DC, order number 300529), the value for “Pin” is always 0.

If you have not connected a supply or charging voltage to terminals V IN and GND, the value for “pin” is also always 0 even if you use a PSU with integrated rechargeable battery (e.g. PSU413D+, order number 300524)

Kind regards
Microtronics Engineering

Hello @MicrotronicsEngineering,

thanks for the clearing, I allready guessed so…

Greetings
stegmaf