This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PGA300: Do you Have the PGA300 EVM DLL Library Manual?

Part Number: PGA300
Other Parts Discussed in Thread: USB2ANY, PGA900

Hi experts,

My customer is going to complete the PGA300 test and develop the mass production tool using Labview.
Customer is  request DLL file and DLL Library Manual for MP Tool.
Is there a manual or source code for reference?
Thaks you for your help.
Br Ik,
  • Hello,

    What MP tool documentation do they already have? The MP tool package should have included this information already.

    Regards,
  • Dear Scott,

    The customer has confirmed the basic operation through PGA300 GUI and USB2ANY.

    Customer is are developing a tool to verify the calibration and operation using Labview for production automation.
    My inquiry was about how to use the PGA300 GUI in Labview and how to register the DLL file to create an automation program.
    I may be asking the wrong question.
     
    If so, can you give me some advice on developing (using Labview) tools for the PGA300 or PGA900 mass production?
    There are many things I do not know because it is the first time, I worry that I made the wrong inquiry.
    Thank you for your help.
    Br, IK
  • Hello IK,

    Sorry for the delay. I'm on international business travel right now, but I'll get back to you once I return on the week of April 22nd.

    Regards,
  • Hi IK,

    I will have to see if we have some sample code in labview that demonstrates the usage of the coefficient calculation DLL and get back to you by May 3rd.

    Regards,
  • Hi IK,

    Attached is a calibration coefficient generation code example in C# using the coefficient gen dll function.

     #region Calibrate_Coefficients
                    case 100:    // Do the Magic - Calibrate the coefficient values
    
    
                        double[] dac_k = new double[4];
                        double[] dac_n = new double[4];
    
                        double[] temp1 = new double[4];
                        double[] temp2 = new double[4];
    
    
                        //   THE CODE BELOW WILL GENERATE k AND n LINEARITY COEFFICIENTS  
                        //   WHICH WILL BE LATER USED FOR DAC LINEARIZATION
    					// Note: This is only for DAC since the DAC might be non-linear when converting code into Voltage
    					//       If the output data is read by a digital interface (For Example I2C) this is not needed
    
                        temp2[0] = Tools.StringBase16IntoDouble(Calib_P1DAC_box.Text) / 16384;
                        temp2[1] = Tools.StringBase16IntoDouble(Calib_P2DAC_box.Text) / 16384;
                        temp2[2] = Tools.StringBase16IntoDouble(Calib_P3DAC_box.Text) / 16384;
                        temp2[3] = Tools.StringBase16IntoDouble(Calib_P4DAC_box.Text) / 16384;
                        if (Calib_ModelSel_combo.Text != "4 Pressure, 4 Temperature") temp2[2] = (temp2[1] + temp2[3]) / 2;
    
    
                        //k1 and n1
                        temp1[0] = Tools.StringBase10_Into_Double(Calib_T1Vo1_box.Text) / Tools.StringBase10_Into_Double(Calib_VDDSupply_box.Text);
                        temp1[1] = Tools.StringBase10_Into_Double(Calib_T1Vo2_box.Text) / Tools.StringBase10_Into_Double(Calib_VDDSupply_box.Text);
                        temp1[2] = Tools.StringBase10_Into_Double(Calib_T1Vo3_box.Text) / Tools.StringBase10_Into_Double(Calib_VDDSupply_box.Text);
                        temp1[3] = Tools.StringBase10_Into_Double(Calib_T1Vo4_box.Text) / Tools.StringBase10_Into_Double(Calib_VDDSupply_box.Text);
                        if (Calib_ModelSel_combo.Text != "4 Pressure, 4 Temperature") temp1[2] = (temp1[1] + temp1[3]) / 2;
    
                        Calc_Slope_Intercept(temp1, temp2, ref dac_k[0], ref dac_n[0]);
    
    
                        //k2 and n2
                        temp1[0] = Tools.StringBase10_Into_Double(Calib_T2Vo1_box.Text) / Tools.StringBase10_Into_Double(Calib_VDDSupply_box.Text);
                        temp1[1] = Tools.StringBase10_Into_Double(Calib_T2Vo2_box.Text) / Tools.StringBase10_Into_Double(Calib_VDDSupply_box.Text);
                        temp1[2] = Tools.StringBase10_Into_Double(Calib_T2Vo3_box.Text) / Tools.StringBase10_Into_Double(Calib_VDDSupply_box.Text);
                        temp1[3] = Tools.StringBase10_Into_Double(Calib_T2Vo4_box.Text) / Tools.StringBase10_Into_Double(Calib_VDDSupply_box.Text);
                        if (Calib_ModelSel_combo.Text != "4 Pressure, 4 Temperature") temp1[2] = (temp1[1] + temp1[3]) / 2;
    
                        Calc_Slope_Intercept(temp1, temp2, ref dac_k[1], ref dac_n[1]);
    
                        //k3 and n3
                        temp1[0] = Tools.StringBase10_Into_Double(Calib_T3Vo1_box.Text) / Tools.StringBase10_Into_Double(Calib_VDDSupply_box.Text);
                        temp1[1] = Tools.StringBase10_Into_Double(Calib_T3Vo2_box.Text) / Tools.StringBase10_Into_Double(Calib_VDDSupply_box.Text);
                        temp1[2] = Tools.StringBase10_Into_Double(Calib_T3Vo3_box.Text) / Tools.StringBase10_Into_Double(Calib_VDDSupply_box.Text);
                        temp1[3] = Tools.StringBase10_Into_Double(Calib_T3Vo4_box.Text) / Tools.StringBase10_Into_Double(Calib_VDDSupply_box.Text);
                        if (Calib_ModelSel_combo.Text != "4 Pressure, 4 Temperature") temp1[2] = (temp1[1] + temp1[3]) / 2;
    
                        Calc_Slope_Intercept(temp1, temp2, ref dac_k[2], ref dac_n[2]);
    
                        //k4 and n4
                        temp1[0] = Tools.StringBase10_Into_Double(Calib_T4Vo1_box.Text) / Tools.StringBase10_Into_Double(Calib_VDDSupply_box.Text);
                        temp1[1] = Tools.StringBase10_Into_Double(Calib_T4Vo2_box.Text) / Tools.StringBase10_Into_Double(Calib_VDDSupply_box.Text);
                        temp1[2] = Tools.StringBase10_Into_Double(Calib_T4Vo3_box.Text) / Tools.StringBase10_Into_Double(Calib_VDDSupply_box.Text);
                        temp1[3] = Tools.StringBase10_Into_Double(Calib_T4Vo4_box.Text) / Tools.StringBase10_Into_Double(Calib_VDDSupply_box.Text);
                        if (Calib_ModelSel_combo.Text != "4 Pressure, 4 Temperature") temp1[2] = (temp1[1] + temp1[3]) / 2;
    
                        Calc_Slope_Intercept(temp1, temp2, ref dac_k[3], ref dac_n[3]);
    
    
                        //   THE CODE BELOW WILL MAP THE DAC NON-LINEARITY TO THE 
                        //   LINEAR DESIRED OUTPUT
    
                        //Generate Desired DAC LSBs
                        temp2[0] = Tools.StringBase10_Into_Double(Calib_P1Vo_box.Text) / 5 * 16384;  // 5V assumed VDD, 16384 because the DAC is 14 bits (2^14 = 16384)
                        temp2[1] = Tools.StringBase10_Into_Double(Calib_P2Vo_box.Text) / 5 * 16384;  // 5V assumed VDD
                        temp2[2] = Tools.StringBase10_Into_Double(Calib_P3Vo_box.Text) / 5 * 16384;  // 5V assumed VDD
                        temp2[3] = Tools.StringBase10_Into_Double(Calib_P4Vo_box.Text) / 5 * 16384;  // 5V assumed VDD
                        //
    
                        // Populate DAC Linearization Matrix
                        double[] DACs_fixed = new double[16];
                        DACs_fixed[0] = dac_k[0] * temp2[0] + dac_n[0];
                        DACs_fixed[4] = dac_k[0] * temp2[1] + dac_n[0];
                        DACs_fixed[8] = dac_k[0] * temp2[2] + dac_n[0];
                        DACs_fixed[12] = dac_k[0] * temp2[3] + dac_n[0];
                        DACs_fixed[1] = dac_k[1] * temp2[0] + dac_n[1];
                        DACs_fixed[5] = dac_k[1] * temp2[1] + dac_n[1];
                        DACs_fixed[9] = dac_k[1] * temp2[2] + dac_n[1];
                        DACs_fixed[13] = dac_k[1] * temp2[3] + dac_n[1];
                        DACs_fixed[2] = dac_k[2] * temp2[0] + dac_n[2];
                        DACs_fixed[6] = dac_k[2] * temp2[1] + dac_n[2];
                        DACs_fixed[10] = dac_k[2] * temp2[2] + dac_n[2];
                        DACs_fixed[14] = dac_k[2] * temp2[3] + dac_n[2];
                        DACs_fixed[3] = dac_k[3] * temp2[0] + dac_n[3];
                        DACs_fixed[7] = dac_k[3] * temp2[1] + dac_n[3];
                        DACs_fixed[11] = dac_k[3] * temp2[2] + dac_n[3];
                        DACs_fixed[15] = dac_k[3] * temp2[3] + dac_n[3];
    
                        //Populate P ADC Linearization Matrix
                        double[] PADCs = new double[16];
                        PADCs[0] = Tools.StringBase16IntoDouble(Calib_P1T1_ADC_box.Text);
                        PADCs[4] = Tools.StringBase16IntoDouble(Calib_P2T1_ADC_box.Text);
                        PADCs[8] = Tools.StringBase16IntoDouble(Calib_P3T1_ADC_box.Text);
                        PADCs[12] = Tools.StringBase16IntoDouble(Calib_P4T1_ADC_box.Text);
                        PADCs[1] = Tools.StringBase16IntoDouble(Calib_P1T2_ADC_box.Text);
                        PADCs[5] = Tools.StringBase16IntoDouble(Calib_P2T2_ADC_box.Text);
                        PADCs[9] = Tools.StringBase16IntoDouble(Calib_P3T2_ADC_box.Text);
                        PADCs[13] = Tools.StringBase16IntoDouble(Calib_P4T2_ADC_box.Text);
                        PADCs[2] = Tools.StringBase16IntoDouble(Calib_P1T3_ADC_box.Text);
                        PADCs[6] = Tools.StringBase16IntoDouble(Calib_P2T3_ADC_box.Text);
                        PADCs[10] = Tools.StringBase16IntoDouble(Calib_P3T3_ADC_box.Text);
                        PADCs[14] = Tools.StringBase16IntoDouble(Calib_P4T3_ADC_box.Text);
                        PADCs[3] = Tools.StringBase16IntoDouble(Calib_P1T4_ADC_box.Text);
                        PADCs[7] = Tools.StringBase16IntoDouble(Calib_P2T4_ADC_box.Text);
                        PADCs[11] = Tools.StringBase16IntoDouble(Calib_P3T4_ADC_box.Text);
                        PADCs[15] = Tools.StringBase16IntoDouble(Calib_P4T4_ADC_box.Text);
    
                        //Populate T ADC Linearization Matrix
                        double[] TADCs = new double[16];
                        TADCs[0] = Tools.StringBase16IntoDouble(Calib_T1_TADC_box.Text);
                        TADCs[4] = Tools.StringBase16IntoDouble(Calib_T1_TADC_box.Text);
                        TADCs[8] = Tools.StringBase16IntoDouble(Calib_T1_TADC_box.Text);
                        TADCs[12] = Tools.StringBase16IntoDouble(Calib_T1_TADC_box.Text);
                        TADCs[1] = Tools.StringBase16IntoDouble(Calib_T2_TADC_box.Text);
                        TADCs[5] = Tools.StringBase16IntoDouble(Calib_T2_TADC_box.Text);
                        TADCs[9] = Tools.StringBase16IntoDouble(Calib_T2_TADC_box.Text);
                        TADCs[13] = Tools.StringBase16IntoDouble(Calib_T2_TADC_box.Text);
                        TADCs[2] = Tools.StringBase16IntoDouble(Calib_T3_TADC_box.Text);
                        TADCs[6] = Tools.StringBase16IntoDouble(Calib_T3_TADC_box.Text);
                        TADCs[10] = Tools.StringBase16IntoDouble(Calib_T3_TADC_box.Text);
                        TADCs[14] = Tools.StringBase16IntoDouble(Calib_T3_TADC_box.Text);
                        TADCs[3] = Tools.StringBase16IntoDouble(Calib_T4_TADC_box.Text);
                        TADCs[7] = Tools.StringBase16IntoDouble(Calib_T4_TADC_box.Text);
                        TADCs[11] = Tools.StringBase16IntoDouble(Calib_T4_TADC_box.Text);
                        TADCs[15] = Tools.StringBase16IntoDouble(Calib_T4_TADC_box.Text);
    
                        for (int i = 0; i < 16; i++)     //Take care of 2's Complement
                        {
                            if (PADCs[i] > 32767) PADCs[i] = PADCs[i] - 65536;	//Here the Data is 16bits from the ADC
                            if (TADCs[i] > 32767) TADCs[i] = TADCs[i] - 65536;	// hence the values 65536 (Full ADC Span) and 32767 (Max Positive value)
                        }
    
                        //Now Calibrate the coefficients and digital gain/offset by using the external dll function
                        double[] Coefficients_norm = new double[16];
                        double[] Coefficients_off = new double[16];
                        int[] Coeff_array_size = new int[2];
                        double Temp_offset_norm = 0;
                        double Temp_offset_off = 0;
                        double Temp_gain_norm = 0;
                        double Temp_gain_off = 0;
                        double Press_offset_norm = 0;
                        double Press_offset_off = 0;
                        double Press_gain_norm = 0;
                        double Press_gain_off = 0;
                        double Fit_Error_norm = 0;
                        double Fit_Error_off = 0;
    
                        // INPUT PARAMETERS INTO Calibration_Coeff_Gen function
                        // CalPoint: 0 - 3P1T Calibration
                        //           1 - 3P3T Calibration
                        //           2 - 4P4T Calibration
                        // Off_Enable: 0 - Normal Version i.e. Fixed_ADC = GAIN * ADC + OFFSET
                        //             1 - Offset Version i.e. Fixed_ADC = GAIN * (ADC + OFFSET)
                        // NormScaleBits: Number of bits to Normalize (For PGA300, PGA302 and PGA304 it is always 14 bits)
    					//											  (For PGA305 it is always 22 bits)
    
                        if (Calib_ModelSel_combo.Text == "4 Pressure, 4 Temperature")
                        {
                            Calibration_Coeff_Gen(2, 0, 14, PADCs, TADCs, DACs_fixed, Coefficients_norm, Coeff_array_size, ref Temp_offset_norm, ref Temp_gain_norm, ref Press_offset_norm, ref Press_gain_norm, ref Fit_Error_norm);
                            Calibration_Coeff_Gen(2, 1, 14, PADCs, TADCs, DACs_fixed, Coefficients_off, Coeff_array_size, ref Temp_offset_off, ref Temp_gain_off, ref Press_offset_off, ref Press_gain_off, ref Fit_Error_off);
                        }
                        else if (Calib_ModelSel_combo.Text == "3 Pressure, 3 Temperature")
                        {
                            Calibration_Coeff_Gen(1, 0, 14, PADCs, TADCs, DACs_fixed, Coefficients_norm, Coeff_array_size, ref Temp_offset_norm, ref Temp_gain_norm, ref Press_offset_norm, ref Press_gain_norm, ref Fit_Error_norm);
                            Calibration_Coeff_Gen(1, 1, 14, PADCs, TADCs, DACs_fixed, Coefficients_off, Coeff_array_size, ref Temp_offset_off, ref Temp_gain_off, ref Press_offset_off, ref Press_gain_off, ref Fit_Error_off);
                        }
                        else if (Calib_ModelSel_combo.Text == "3 Pressure, 1 Temperature")
                        {
                            Calibration_Coeff_Gen(0, 0, 14, PADCs, TADCs, DACs_fixed, Coefficients_norm, Coeff_array_size, ref Temp_offset_norm, ref Temp_gain_norm, ref Press_offset_norm, ref Press_gain_norm, ref Fit_Error_norm);
                            Calibration_Coeff_Gen(0, 1, 14, PADCs, TADCs, DACs_fixed, Coefficients_off, Coeff_array_size, ref Temp_offset_off, ref Temp_gain_off, ref Press_offset_off, ref Press_gain_off, ref Fit_Error_off);
                        }
    
    
                        if (Fit_Error_norm == 1 && Fit_Error_off == 1)
                        {
                            Calib_Status_box.Text = "Error: Calibration Completed with unsuccessful results.\r\nInfo: Please Check your system settings and configuration and try again.\r\nInfo: If the issue persists please contact Texas Instruments Support.\r\n";
                            Calib_CANCEL_button.PerformClick();
                            break;
                        }
    
    					// The code below will decide which Version (Normal or Offset) has calculated a lower Simulated Error
    					// and will propose those calibration values. 
    					
                        if (Fit_Error_norm < Fit_Error_off)      // Normal Version Wins
                        {
                            for (int i = 0; i < 16; i++)
                                Calib_Coefficients_final[i] = (int)(Coefficients_norm[i] * 16384);	//16384 because NormScaleBits = 14
    
                            Calib_Temp_offset_final = (int)Temp_offset_norm;
                            Calib_Temp_gain_final = (int)Temp_gain_norm;
                            Calib_Press_offset_final = (int)Press_offset_norm;
                            Calib_Press_gain_final = (int)Press_gain_norm;
    
                            Calib_Norm_notOff = true;
    
                            Calib_Status_box.Text = "Info: Calibration Completed. Normal mode Algorithm used for lowest error.\r\n";
                            Calib_Status_box.Text += "Info: Simulated Fit Error Value = " + Fit_Error_norm.ToString() + "\r\n";
                        }
                        else                                    // Offset Version Wins
                        {
                            for (int i = 0; i < 16; i++)
                                Calib_Coefficients_final[i] = (int)(Coefficients_off[i] * 16384);	//16384 because NormScaleBits = 14
    
                            Calib_Temp_offset_final = (int)Temp_offset_off;
                            Calib_Temp_gain_final = (int)Temp_gain_off;
                            Calib_Press_offset_final = (int)Press_offset_off;
                            Calib_Press_gain_final = (int)Press_gain_off;
    
                            Calib_Norm_notOff = false;
    
                            Calib_Status_box.Text = "Info: Calibration Completed. Offset mode Algorithm used for lowest error.\r\n";
                            Calib_Status_box.Text += "Info: Simulated Fit Error Value = " + Fit_Error_off.ToString() + "\r\n";
                        }
    
                        Calib_Status_box.Text += "\r\n";
                        Calib_Status_box.Text += "Info: Best Fit Calibrated Coefficients Results:\r\n";
                        Calib_Status_box.Text += "H0 = " + Calib_Coefficients_final[0].ToString() + "\r\n";
                        Calib_Status_box.Text += "H1 = " + Calib_Coefficients_final[1].ToString() + "\r\n";
                        Calib_Status_box.Text += "H2 = " + Calib_Coefficients_final[2].ToString() + "\r\n";
                        Calib_Status_box.Text += "H3 = " + Calib_Coefficients_final[3].ToString() + "\r\n";
                        Calib_Status_box.Text += "G0 = " + Calib_Coefficients_final[4].ToString() + "\r\n";
                        Calib_Status_box.Text += "G1 = " + Calib_Coefficients_final[5].ToString() + "\r\n";
                        Calib_Status_box.Text += "G2 = " + Calib_Coefficients_final[6].ToString() + "\r\n";
                        Calib_Status_box.Text += "G3 = " + Calib_Coefficients_final[7].ToString() + "\r\n";
                        Calib_Status_box.Text += "N0 = " + Calib_Coefficients_final[8].ToString() + "\r\n";
                        Calib_Status_box.Text += "N1 = " + Calib_Coefficients_final[9].ToString() + "\r\n";
                        Calib_Status_box.Text += "N2 = " + Calib_Coefficients_final[10].ToString() + "\r\n";
                        Calib_Status_box.Text += "N3 = " + Calib_Coefficients_final[11].ToString() + "\r\n";
                        Calib_Status_box.Text += "M0 = " + Calib_Coefficients_final[12].ToString() + "\r\n";
                        Calib_Status_box.Text += "M1 = " + Calib_Coefficients_final[13].ToString() + "\r\n";
                        Calib_Status_box.Text += "M2 = " + Calib_Coefficients_final[14].ToString() + "\r\n";
                        Calib_Status_box.Text += "M3 = " + Calib_Coefficients_final[15].ToString() + "\r\n";
                        Calib_Status_box.Text += "\r\n";
                        Calib_Status_box.Text += "Info: Best Fit Gain and Offset Results:\r\n";
                        Calib_Status_box.Text += "Pressure (PADC) Gain = " + Calib_Press_gain_final.ToString() + "\r\n";
                        Calib_Status_box.Text += "Pressure (PADC) Offset = " + Calib_Press_offset_final.ToString() + "\r\n";
                        Calib_Status_box.Text += "Temperature (TADC) Gain = " + Calib_Temp_gain_final.ToString() + "\r\n";
                        Calib_Status_box.Text += "Temperature (TADC) Offset = " + Calib_Temp_offset_final.ToString() + "\r\n";
                        Calib_Status_box.Text += "\r\n";
    
                        Calib_Status_box.Text += "\r\n";
                        Calib_Status_box.Text += "To Program the Calculated Parameters to EEPROM click PROGRAM, otherwise click CANCEL.\r\n";
                        Calib_START_NEXT_button.Text = "PROGRAM";
                        calib_state_indx = 200;
    
    					//	Note: Keep in mind that even after this code has completed the Calibration Coefficients are still in the Decimal format.
    					//		  The following case 200 (case "PROGRAM") which is not shown here will convert the decimal values into 2's complement HEX values.
    					//		  For PGA300, PGA302 and PGA304 these are 16 bits including the sign bit, for PGA305 these are 24 bits including the sign bit.
    					
                        break;
                    #endregion

    Regards,

  • dear Scott.

    Thank you for your kind support.

    It is very help to me.

    Thank you.

    Br IK.