Author Topic: Serial Driver to SLC 5/03  (Read 1765 times)

abouhaa

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Serial Driver to SLC 5/03
« on: January 21, 2019, 04:14:38 PM »
Is there something I have to add to code to close com port before form closes?
When I first power up my pc, the application will run fine. If I close the application and re open it, it wont find the PLC again and no data gets received; looks like com port is busy or something.

If I restart my PC and restart the AdvancedHMI application it will start again no problem.
« Last Edit: January 21, 2019, 04:17:16 PM by abouhaa »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5323
    • View Profile
    • AdvancedHMI
Re: Serial Driver to SLC 5/03
« Reply #1 on: January 21, 2019, 04:21:55 PM »
When the last driver instance is disposed, it will close the port. Or when the application is exited.

After you close your app, is it possibly still running in the background. Check this in System Manager.

abouhaa

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Serial Driver to SLC 5/03
« Reply #2 on: January 22, 2019, 08:29:42 AM »
When debugging from visual studio, closing the form gives me no problem when I try to start debugging again. Running the application on a windows 7 embedded std is where I have the problem.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5323
    • View Profile
    • AdvancedHMI
Re: Serial Driver to SLC 5/03
« Reply #3 on: January 22, 2019, 08:47:36 AM »
Things can behave different in VS. For instance if you use the stop button, it will kill all forms whether hidden or not. Outside of VS the main form can be hidden leaving no way to stop the application without task manager.

abouhaa

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Serial Driver to SLC 5/03
« Reply #4 on: January 22, 2019, 11:06:32 AM »
I checked the task manager.. I can see the application close under the application tab and the process also closes under the process tab..

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5323
    • View Profile
    • AdvancedHMI
Re: Serial Driver to SLC 5/03
« Reply #5 on: January 22, 2019, 05:43:17 PM »
Set EnableLogging property to True, then start the application and let it run for a minute, then close it. Check in the directory where the executable is and post the log files that was generated.

abouhaa

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Serial Driver to SLC 5/03
« Reply #6 on: January 23, 2019, 08:29:52 AM »
What type of files are you looking for? Extensions?

Also I need to mention that today I welcomed another issue... The application works fine on visual studio, but once I publish it to my desktop and run the setup, the application will start but no data gets received. If I stop the application from my desktop and run it again from visual studio it runs fine...
I even tried to take the publish setup folder and install it on another PC and still does not work..

I checked the "application files" tab and made sure all files are included in the publish so that nothing required is missing.
« Last Edit: January 23, 2019, 08:31:45 AM by abouhaa »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5323
    • View Profile
    • AdvancedHMI
Re: Serial Driver to SLC 5/03
« Reply #7 on: January 23, 2019, 08:33:47 AM »
The file will be driverlog. It will be easy to find because there should only be about 10 files in the directory.

Do not use Publish. See this :

https://www.advancedhmi.com/forum/index.php?topic=14.msg37#msg37

abouhaa

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Serial Driver to SLC 5/03
« Reply #8 on: January 23, 2019, 08:45:15 AM »
Wow that has fixed it.
Don't know how but Publish used to work all the time no problem.

I will just copy the .exe as you said.

Thanks a lot.