Ejemplo n.º 1
0
        public static async Task SetBatteryTestModeParameters(UdpClient client, int list_index, double current_range,
                                                              double discharge_current, double cutoff_voltage, double cutoff_capacity, double discharge_time)
        {
            var tx_bytes = Encoding.ASCII.GetBytes(":BATT " + list_index + "," + KEL103Tools.FormatString(current_range) +
                                                   "A," + KEL103Tools.FormatString(discharge_current) + "A," + KEL103Tools.FormatString(cutoff_voltage) +
                                                   "V," + KEL103Tools.FormatString(cutoff_capacity) + "AH," + KEL103Tools.FormatString(discharge_time) + "S\n");

            await client.SendAsync(tx_bytes, tx_bytes.Length);
        }
        public static async Task SetDynamicMode(UdpClient client, int mode, double low_value, double high_value, double frequency, double duty_cycle)
        {
            string mode_string = mode + "," + KEL103Tools.FormatString(low_value) + dynamic_mode_suffix_strings[mode - 1] + "," +
                                 KEL103Tools.FormatString(high_value) + dynamic_mode_suffix_strings[mode - 1] + "," + KEL103Tools.FormatString(frequency) + "HZ," +
                                 KEL103Tools.FormatString(duty_cycle) + "%";

            var tx_bytes = Encoding.ASCII.GetBytes(":DYN " + mode_string + "\n");

            await client.SendAsync(tx_bytes, tx_bytes.Length);
        }
        //these work but don't seem to do anything
        public static async Task SetDynamicMode_Pulse(UdpClient client, double low_slope, double high_slope, double low_current,
                                                      double high_current, double time)
        {
            string mode_string = 5 + "," + KEL103Tools.FormatString(low_slope) + "A/uS," +
                                 KEL103Tools.FormatString(high_slope) + "A/uS," + KEL103Tools.FormatString(low_current) + "A," +
                                 KEL103Tools.FormatString(high_current) + "A," + KEL103Tools.FormatString(time) + "S";

            var tx_bytes = Encoding.ASCII.GetBytes(":DYN " + mode_string + "\n");

            await client.SendAsync(tx_bytes, tx_bytes.Length);
        }
Ejemplo n.º 4
0
        public static async Task SetConstantResistanceTarget(UdpClient client, double target_resistance)
        {
            var tx_bytes = Encoding.ASCII.GetBytes(":RES " + KEL103Tools.FormatString(target_resistance) + "OHM\n");

            await client.SendAsync(tx_bytes, tx_bytes.Length);
        }
Ejemplo n.º 5
0
        public static async Task SetConstantCurrentTarget(UdpClient client, double target_current)
        {
            var tx_bytes = Encoding.ASCII.GetBytes(":CURR " + KEL103Tools.FormatString(target_current) + "A\n");

            await client.SendAsync(tx_bytes, tx_bytes.Length);
        }
Ejemplo n.º 6
0
        public static async Task SetConstantVoltageTarget(UdpClient client, double target_voltage)
        {
            var tx_bytes = Encoding.ASCII.GetBytes(":VOLT " + KEL103Tools.FormatString(target_voltage) + "V\n");

            await client.SendAsync(tx_bytes, tx_bytes.Length);
        }
Ejemplo n.º 7
0
        public static async Task SetConstantPowerTarget(UdpClient client, double target_power)
        {
            var tx_bytes = Encoding.ASCII.GetBytes(":POW " + KEL103Tools.FormatString(target_power) + "W\n");

            await client.SendAsync(tx_bytes, tx_bytes.Length);
        }