Author Topic: Cause of System.FormatException and System.ArgumentException  (Read 2826 times)

scott.clark

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Cause of System.FormatException and System.ArgumentException
« on: January 16, 2015, 04:47:16 PM »
using AdvancedHMI v3.97c  Visual studio 13

I am seeing these exceptions in my Debug Output Window.  Any suggestions on how to track them down.

A first chance exception of type 'System.FormatException' occurred in mscorlib.dll
A first chance exception of type 'System.ArgumentException' occurred in System.Drawing.dll

Thanks!

Godra

  • Hero Member
  • *****
  • Posts: 1443
    • View Profile

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5311
    • View Profile
    • AdvancedHMI
Re: Cause of System.FormatException and System.ArgumentException
« Reply #2 on: January 16, 2015, 07:09:58 PM »
What controls do you have on your form?

When the output windows shows an exception, it typically means an exception occurred, but was trapped and handled, so it will not dump the application.

scott.clark

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: Cause of System.FormatException and System.ArgumentException
« Reply #3 on: January 16, 2015, 07:45:56 PM »
This may give you some idea.....


        Me.components = New System.ComponentModel.Container()
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(MainForm))
        Me.grpboxModelSelection = New System.Windows.Forms.GroupBox()
        Me.lblReadWriteEventCnt = New System.Windows.Forms.Label()
        Me.lblReadWriteElapsedTimes = New System.Windows.Forms.Label()
        Me.txtScannedSubAssemblyNumber = New System.Windows.Forms.TextBox()
        Me.txtUnitModelNumber = New System.Windows.Forms.TextBox()
        Me.btn_PLCTest = New System.Windows.Forms.Button()
        Me.lblScannedSubAssyNumber = New System.Windows.Forms.Label()
        Me.btnTestRTU = New System.Windows.Forms.Button()
        Me.lblUnitModelNumber = New System.Windows.Forms.Label()
        Me.btnShowfrmModbusRTU = New System.Windows.Forms.Button()
        Me.txtScannerInput = New System.Windows.Forms.TextBox()
        Me.ButtonCheckSN = New System.Windows.Forms.Button()
        Me.txtUnitSerialNumber = New System.Windows.Forms.TextBox()
        Me.lblUnitSerialNumber = New System.Windows.Forms.Label()
        Me.lblScannerInput = New System.Windows.Forms.Label()
        Me.OutputWindow = New System.Windows.Forms.RichTextBox()
        Me.CycleTimer = New System.Windows.Forms.Timer(Me.components)
        Me.FaultTimer = New System.Windows.Forms.Timer(Me.components)
        Me.EthernetIPforCLXCom_MainForm = New AdvancedHMIDrivers.EthernetIPforCLXCom(Me.components)
        Me.grpboxSystemStatus = New System.Windows.Forms.GroupBox()
        Me.btnRejectPBInd = New System.Windows.Forms.Button()
        Me.basindCycleStartPBPressed = New AdvancedHMIControls.BasicIndicator()
        Me.basindRetestPBPressed = New AdvancedHMIControls.BasicIndicator()
        Me.basindRejectPBIndPressed = New AdvancedHMIControls.BasicIndicator()
        Me.lblButtonPressed = New System.Windows.Forms.Label()
        Me.lblPLCStage = New System.Windows.Forms.Label()
        Me.lblInCycle = New System.Windows.Forms.Label()
        Me.lblDixellComm = New System.Windows.Forms.Label()
        Me.lblStartConditions = New System.Windows.Forms.Label()
        Me.lblScannerComm = New System.Windows.Forms.Label()
        Me.lblReadyToRun = New System.Windows.Forms.Label()
        Me.lblPLCComm = New System.Windows.Forms.Label()
        Me.lblPLCStageValue = New System.Windows.Forms.Label()
        Me.pbStartConditions = New System.Windows.Forms.PictureBox()
        Me.pbReadyToRun = New System.Windows.Forms.PictureBox()
        Me.pbButtonPressed = New System.Windows.Forms.PictureBox()
        Me.pbScannerComm = New System.Windows.Forms.PictureBox()
        Me.pbDixellComm = New System.Windows.Forms.PictureBox()
        Me.pbInCycle = New System.Windows.Forms.PictureBox()
        Me.pbPLCComm = New System.Windows.Forms.PictureBox()
        Me.lblTestResults = New System.Windows.Forms.RichTextBox()
        Me.cmdMenu = New System.Windows.Forms.Button()
        Me.MainTimer = New System.Windows.Forms.Timer(Me.components)
        Me.StatusStrip1 = New System.Windows.Forms.StatusStrip()
        Me.ToolStripStatusLabel1 = New System.Windows.Forms.ToolStripStatusLabel()
        Me.ToolStripStatusLabel2 = New System.Windows.Forms.ToolStripStatusLabel()
        Me.ToolStripStatusLabel3 = New System.Windows.Forms.ToolStripStatusLabel()
        Me.ToolStripStatusLabel4 = New System.Windows.Forms.ToolStripStatusLabel()
        Me.ToolStripStatusLabel5 = New System.Windows.Forms.ToolStripStatusLabel()
        Me.TabControlMain = New System.Windows.Forms.TabControl()
        Me.TabPage1 = New System.Windows.Forms.TabPage()
        Me.lblMainDischPSIValue = New System.Windows.Forms.Label()
        Me.lblMainDischPSI = New System.Windows.Forms.Label()
        Me.lblMainAmpsValue = New System.Windows.Forms.Label()
        Me.lblMainAmps = New System.Windows.Forms.Label()
        Me.lblMainVoltsValue = New System.Windows.Forms.Label()
        Me.lblMainVolts = New System.Windows.Forms.Label()
        Me.lblOperatorInformation = New System.Windows.Forms.Label()
        Me.cmdShowInstructions = New System.Windows.Forms.Button()
        Me.TabPage2 = New System.Windows.Forms.TabPage()
        Me.checkFanCyclingPresent = New System.Windows.Forms.CheckBox()
        Me.lblElectricalLabelNumber = New System.Windows.Forms.Label()
        Me.txtElectricalLabelNumber = New System.Windows.Forms.TextBox()
        Me.lblPhase = New System.Windows.Forms.Label()
        Me.txtPhase = New System.Windows.Forms.TextBox()
        Me.lblSolenoidPartNumber = New System.Windows.Forms.Label()
        Me.txtSolenoidPartNumber = New System.Windows.Forms.TextBox()
        Me.lblDixellProgram = New System.Windows.Forms.Label()
        Me.txtDixellProgram = New System.Windows.Forms.TextBox()
        Me.lblHP = New System.Windows.Forms.Label()
        Me.txtHP = New System.Windows.Forms.TextBox()
        Me.lblHipotProgramNumber = New System.Windows.Forms.Label()
        Me.txtHipotProgramNumber = New System.Windows.Forms.TextBox()
        Me.lblDixellModule = New System.Windows.Forms.Label()
        Me.txtDixellModule = New System.Windows.Forms.TextBox()
        Me.lblRLA = New System.Windows.Forms.Label()
        Me.txtRLA = New System.Windows.Forms.TextBox()
        Me.lblRevContactorPartNumber = New System.Windows.Forms.Label()
        Me.txtRevContactorPartNumber = New System.Windows.Forms.TextBox()
        Me.lblSubAssemblyNumber = New System.Windows.Forms.Label()
        Me.txtSubAssemblyNumber = New System.Windows.Forms.TextBox()
        Me.lblVoltage = New System.Windows.Forms.Label()
        Me.txtVoltage = New System.Windows.Forms.TextBox()
        Me.TabPage3 = New System.Windows.Forms.TabPage()
        Me.lblHiAmpsDeviationValue = New System.Windows.Forms.Label()
        Me.txtHiAmpsDeviationValue = New System.Windows.Forms.TextBox()
        Me.lblLoDeviationValue = New System.Windows.Forms.Label()
        Me.txtLoDeviationValue = New System.Windows.Forms.TextBox()
        Me.lblMaxWaitTime = New System.Windows.Forms.Label()
        Me.txtMaxWaitTime = New System.Windows.Forms.TextBox()
        Me.lblMinStartCheckTime = New System.Windows.Forms.Label()
        Me.txtMinStartCheckTime = New System.Windows.Forms.TextBox()
        Me.lblMinDischargePressure = New System.Windows.Forms.Label()
        Me.txtMinDischargePressure = New System.Windows.Forms.TextBox()
        Me.lblMinSuctionPressure = New System.Windows.Forms.Label()
        Me.txtMinSuctionPressure = New System.Windows.Forms.TextBox()
        Me.TabPage4 = New System.Windows.Forms.TabPage()
        Me.lblFailReason = New System.Windows.Forms.Label()
        Me.txtFailReason = New System.Windows.Forms.TextBox()
        Me.lblAttemptNumber = New System.Windows.Forms.Label()
        Me.txtAttemptNumber = New System.Windows.Forms.TextBox()
        Me.lblTestTimeInSeconds = New System.Windows.Forms.Label()
        Me.txtTestTimeInSeconds = New System.Windows.Forms.TextBox()
        Me.lblDischargePressureSnapshotRev = New System.Windows.Forms.Label()
        Me.txtDischargePressureSnapshotRev = New System.Windows.Forms.TextBox()
        Me.lblDischargePressureSnapshotFwd = New System.Windows.Forms.Label()
        Me.txtDischargePressureSnapshotFwd = New System.Windows.Forms.TextBox()
        Me.lblVoltsSnapshotRev = New System.Windows.Forms.Label()
        Me.txtVoltsSnapshotRev = New System.Windows.Forms.TextBox()
        Me.lblVoltsSnapshotFwd = New System.Windows.Forms.Label()
        Me.txtVoltsSnapshotFwd = New System.Windows.Forms.TextBox()
        Me.lblAmpsSnapshotRev = New System.Windows.Forms.Label()
        Me.txtAmpsSnapshotRev = New System.Windows.Forms.TextBox()
        Me.lblAmpsSnapshotFwd = New System.Windows.Forms.Label()
        Me.txtAmpsSnapshotFwd = New System.Windows.Forms.TextBox()
        Me.TabPage5 = New System.Windows.Forms.TabPage()
        Me.TabPage6 = New System.Windows.Forms.TabPage()
        Me.TabPage7 = New System.Windows.Forms.TabPage()
        Me.TabPage8 = New System.Windows.Forms.TabPage()
        Me.TabPage9 = New System.Windows.Forms.TabPage()
        Me.lblScaledDischargePressureValue = New System.Windows.Forms.Label()
        Me.lblScaledDischargePressure = New System.Windows.Forms.Label()
        Me.lblScaledAmpsValue = New System.Windows.Forms.Label()
        Me.lblScaledAmps = New System.Windows.Forms.Label()
        Me.lblScaledVoltsValue = New System.Windows.Forms.Label()
        Me.lblScaledVolts = New System.Windows.Forms.Label()
        Me.TabPage10 = New System.Windows.Forms.TabPage()
        Me.PerformanceCounter1 = New System.Diagnostics.PerformanceCounter()
        Me.StatusDisplay1 = New StatusDisplay.StatusDisplay()
        Me.DixellSerialPortForTest = New System.IO.Ports.SerialPort(Me.components)
        Me.DataSubscriber_PLCFunctions = New AdvancedHMIControls.DataSubscriber(Me.components)
        Me.PictureBox_DestechLogo = New System.Windows.Forms.PictureBox()
        Me.PictureBox_Header = New System.Windows.Forms.PictureBox()
        Me.grpboxModelSelection.SuspendLayout()
        Me.grpboxSystemStatus.SuspendLayout()
        CType(Me.pbStartConditions, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.pbReadyToRun, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.pbButtonPressed, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.pbScannerComm, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.pbDixellComm, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.pbInCycle, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.pbPLCComm, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.StatusStrip1.SuspendLayout()
        Me.TabControlMain.SuspendLayout()
        Me.TabPage1.SuspendLayout()
        Me.TabPage2.SuspendLayout()
        Me.TabPage3.SuspendLayout()
        Me.TabPage4.SuspendLayout()
        Me.TabPage5.SuspendLayout()
        Me.TabPage9.SuspendLayout()
        CType(Me.PerformanceCounter1, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.DataSubscriber_PLCFunctions, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.PictureBox_DestechLogo, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.PictureBox_Header, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5311
    • View Profile
    • AdvancedHMI
Re: Cause of System.FormatException and System.ArgumentException
« Reply #4 on: January 16, 2015, 08:06:52 PM »
It looks like the BasicIndicator is the only AdvancedHMI visual control. I will test it to see if I get the same exceptions showing in the output window.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5311
    • View Profile
    • AdvancedHMI
Re: Cause of System.FormatException and System.ArgumentException
« Reply #5 on: January 16, 2015, 09:05:23 PM »
I'm not seeing any of these exceptions with a BasicIndicator. Are you using Try-Catch any where in your code?