You are on page 1of 1

variables

{
message CAN4.Power Power_Tx;
float voltage_rx=0;
float current_rx=0;
float power_calculated=0;
}
on message CAN4.Probe1
{
current_rx=this.P1T2_100yA*P1T2_100yA.factor;
write("Current %f",current_rx);
}
on message CAN4.Uaux
{
voltage_rx = this.Uaux*Uaux.factor;
write("Voltage %f",voltage_rx);
power_calculated= voltage_rx*current_rx;
Power_Tx.Power=power_calculated;
output(Power_Tx);
}

You might also like