AdvancedHMI Software

General Category => Open Discussion => Topic started by: hsreekumary on March 16, 2023, 01:58:44 PM

Title: App freeze AHMI V3.99x +Keyence SDK+SQLCE
Post by: hsreekumary on March 16, 2023, 01:58:44 PM
I am using AHMI for connecting a Micrologix 1100 to SQL compact server. I have Keyence libraries to trigger a barcode scanner as well. But it crashes unexpectedly. I have been getting FormatExceptions all the time on the output. I tried to resolve it as much as possible. Any thoughts?
Title: Re: App freeze AHMI V3.99x +Keyence SDK+SQLCE
Post by: Archie on March 16, 2023, 02:49:18 PM
Do you get any details on where the exception occurs?
Title: Re: App freeze AHMI V3.99x +Keyence SDK+SQLCE
Post by: hsreekumary on March 16, 2023, 02:51:04 PM
All the time.  :( so I don't remember if it used to do before. I have only started looking at output window now.
Title: Re: App freeze AHMI V3.99x +Keyence SDK+SQLCE
Post by: hsreekumary on March 20, 2023, 08:17:02 AM
@Archie
you got to help me here :'( . Initially I used messaging to communicate with the Sr-1000 barcode scanner. But I got into problems when I had to modify anything on the subroutine where I had message instructions. Rockwell says its a bug in RSlogix 500 and Rockwell said they don't fix this for Micrologic Controllers. Otherwise I was using AHMI only to use the SQL Compact Server. I dont see anything when it crashes. Also it doesnt do that on debug mode. It happens all the time when I run it from the debug or release folder.
Title: Re: App freeze AHMI V3.99x +Keyence SDK+SQLCE
Post by: Archie on March 20, 2023, 12:16:34 PM
I need more details. Your program has a lot of code that was written, so I need to know where the crash occurs to know if it's in the code or in AdvancedHMI.
Title: Re: App freeze AHMI V3.99x +Keyence SDK+SQLCE
Post by: hsreekumary on March 20, 2023, 12:59:33 PM
Is there anyway I can get the exception details when it freezes when I run the release version of the app. because this happens mostly when I run the EXE file.
Title: Re: App freeze AHMI V3.99x +Keyence SDK+SQLCE
Post by: Archie on March 20, 2023, 01:24:07 PM
Does the PC completely freeze or do you get an exception crash?
Title: Re: App freeze AHMI V3.99x +Keyence SDK+SQLCE
Post by: bachphi on March 20, 2023, 01:44:31 PM
Try this

Code: [Select]
Imports Keyence.AutoID.SDK
...
Dim m_reader As ReaderAccessor = New ReaderAccessor("192.168.111.104")
...

m_reader.Connect(AddressOf ReceivedDataAction)
...
Private Sub ReceivedDataAction(data As Byte())
        'Define received data actions here.Defined actions work asynchronously.
        '"ReceivedDataWrite" works when reading data was received.
        BeginInvoke(New delegateUserControl(AddressOf ReceivedDataWrite), System.Text.Encoding.ASCII.GetString(data))
End Sub
...
m_reader.Dispose()

Make sure to install the run time C++ library SR SDK.
Referencing two Keyence.AutoID.SDK.dll & Communication.dll
Title: Re: App freeze AHMI V3.99x +Keyence SDK+SQLCE
Post by: hsreekumary on March 20, 2023, 02:08:35 PM
Does the PC completely freeze or do you get an exception crash?
Just app freezes. It doesn't show any exceptions. I will have to close the app from the taskbar.
Title: Re: App freeze AHMI V3.99x +Keyence SDK+SQLCE
Post by: hsreekumary on March 27, 2023, 10:22:27 AM
Try this

Code: [Select]
Imports Keyence.AutoID.SDK
...
Dim m_reader As ReaderAccessor = New ReaderAccessor("192.168.111.104")
...

m_reader.Connect(AddressOf ReceivedDataAction)
...
Private Sub ReceivedDataAction(data As Byte())
        'Define received data actions here.Defined actions work asynchronously.
        '"ReceivedDataWrite" works when reading data was received.
        BeginInvoke(New delegateUserControl(AddressOf ReceivedDataWrite), System.Text.Encoding.ASCII.GetString(data))
End Sub
...
m_reader.Dispose()

Make sure to install the run time C++ library SR SDK.
Referencing two Keyence.AutoID.SDK.dll & Communication.dll
I have to try that. I have used a different sample program to make this.
Does the PC completely freeze or do you get an exception crash?
Just app freezes. It doesn't show any exceptions. I will have to close the app from the taskbar.
This what shows up everytime. It creates this exception every time
Exception thrown: 'System.FormatException' in mscorlib.dll
Exception thrown: 'System.FormatException' in mscorlib.dll
Title: Re: App freeze AHMI V3.99x +Keyence SDK+SQLCE
Post by: AnnPark on March 31, 2023, 04:19:04 AM
I am using AHMI for connecting a Micrologix 1100 to SQL compact server. I have Keyence libraries to trigger a barcode scanner as well. But it crashes unexpectedly. I have been getting FormatExceptions all the time on the output. I tried to resolve it as much as possible. Any thoughts?
To troubleshoot FormatExceptions when using AHMI to connect a Micrologix 1100 to SQL Compact Server and trigger a barcode scanner with Keyence libraries, you can try checking your code for format errors, reviewing the library instructions, checking the event log for additional error messages, updating your software, and seeking support from the AHMI and Keyence library teams.



Title: Re: App freeze AHMI V3.99x +Keyence SDK+SQLCE
Post by: hsreekumary on April 05, 2023, 10:31:44 AM
Try this

Code: [Select]
Imports Keyence.AutoID.SDK
...
Dim m_reader As ReaderAccessor = New ReaderAccessor("192.168.111.104")
...

m_reader.Connect(AddressOf ReceivedDataAction)
...
Private Sub ReceivedDataAction(data As Byte())
        'Define received data actions here.Defined actions work asynchronously.
        '"ReceivedDataWrite" works when reading data was received.
        BeginInvoke(New delegateUserControl(AddressOf ReceivedDataWrite), System.Text.Encoding.ASCII.GetString(data))
End Sub
...
m_reader.Dispose()

Make sure to install the run time C++ library SR SDK.
Referencing two Keyence.AutoID.SDK.dll & Communication.dll

I rewrote the whole program to use the methods used in your reply. It has not crashed yet. It is been almost over a week now.
Thanks to everyone who replied. I really appreciate this.
Thank you Archie for making AHMI.