Author Topic: TCP comError stops in several minutes after start the program  (Read 5143 times)

muratguenduez

  • Newbie
  • *
  • Posts: 22
    • View Profile
TCP comError stops in several minutes after start the program
« on: October 18, 2017, 06:12:00 AM »
Code: [Select]
private void timer1_Tick(object sender, EventArgs e)// 1 SECOND
{ i++;
 if(i==5) {lbl_infoG1.Visible = false; i=0;}
}

private void modbusTCPg1_ComError(object sender, MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs e)
        {
            lbl_infoG1.Text = "WARNING!!!"; lbl_infoG1.Visible = true;           
        }


hello designers,
this gives me a message on the screen that i put the label as you see. i run the program and everything normal about this comError event but after a few minute comErroe event stops and label disappear due to visible = false in timer tick.

why does it stops?
thanks.
« Last Edit: October 18, 2017, 06:18:52 AM by muratguenduez »

muratguenduez

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: TCP comError stops in several minutes after start the program
« Reply #1 on: October 18, 2017, 07:17:07 AM »
i have just tried a way of the understand how many times occurs.

Code: [Select]
private void modbusTcpG1_ComError(object sender, MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs e)
        {
            count++; label7.Text = count.ToString();
         }

it stoped at 85, 83, 85.

why  ?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: TCP comError stops in several minutes after start the program
« Reply #2 on: October 18, 2017, 08:32:18 AM »
What is e.ErrorMessage ? Can you run a Wireshark capture to see if there is still any communications after the error event stops firing?

muratguenduez

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: TCP comError stops in several minutes after start the program
« Reply #3 on: October 18, 2017, 09:00:12 AM »
thanks your answer,
actually i have no devices to control so i have no physicaly connection just pc. i defined a tcp modbus driver and i will check the no connection issues. comError event occurs 85 times then stops. it maybe try 85 times then activate a flag i dont know. please just try simple code like me.

int count=0;
private void modbusTcpG1_ComError(object sender, MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs e)
        {
            count++; label7.Text = count.ToString();
         }

otherwise, all analogValueDisplays show us "Could not connect..... 10.1.1.5 bla bla..." periodicly during this time. after stop the event all analogvaluedisplays turn to 0 and no response.

where can i get that error message ?


muratguenduez

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: TCP comError stops in several minutes after start the program
« Reply #4 on: October 18, 2017, 10:38:06 AM »
i tried something else.
disabled all error events of modbustcps and i checked after all analogvaluedisplays dont show any error message and i sent modbustcp.write(...) and feedback is ok. so connection doesnt stop but comerror subrutine event stops in approximately 100 second or 85 times.


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: TCP comError stops in several minutes after start the program
« Reply #5 on: October 18, 2017, 11:56:26 AM »
I tried to replicate this, but not able to. At the time of this posting, my app is over 600 times executing the Error event. Are you using version 3.99x?

muratguenduez

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: TCP comError stops in several minutes after start the program
« Reply #6 on: October 25, 2017, 04:04:28 AM »
mine is aproximately 85. i m using 3.99w. is it about version  ?

how can i update to 3.99x without breaking my work? if i copy and replace all patch files at their location, will it work ?
« Last Edit: October 25, 2017, 05:10:29 AM by muratguenduez »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: TCP comError stops in several minutes after start the program
« Reply #7 on: October 25, 2017, 08:39:39 AM »
Download and extract the latest version
Open in VS
In Solution Explorer, right click the AdvancedHMI project and select Add Existing Item
Browse to the .vb file for each of your forms. Be sure to only select 1 at a time

Phrog30

  • Guest
Re: TCP comError stops in several minutes after start the program
« Reply #8 on: October 25, 2017, 09:08:20 AM »
how can i update to 3.99x...
I recommend creating a folder that you use for all of your stuff.  Then when you update all you do is copy this folder (via Windows - VS not running).  Then open VS and show all files and add this folder to the project.  Done!

muratguenduez

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: TCP comError stops in several minutes after start the program
« Reply #9 on: October 27, 2017, 09:50:45 AM »
i extract the 3.99x, then open in vs, i deleted " AdvancedHMIcs "in solution explorer, then right clicked on solution explorer then clicked on "existing project" then i selected  my .sln file.  it is working but i cant see my one of forms for edit. you know the white screen with errors i clicked on ignore and continue =) errors of all analogvalue displays but when i clicked on go to error, there is no red-subline with the line !
 
in the end, i tried again that issue then result is same.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: TCP comError stops in several minutes after start the program
« Reply #10 on: October 27, 2017, 10:02:52 AM »
I think you only opened your same project and not upgraded. Here is what you need to do:

1) Download and extract version 3.99x
2) Open 3.99x in Visual Studio
3) Build the solution
4) In Solution Explorer, right click the AdvancedHMI Project (Not the solution) and select Add Existing Item
5) Browse to the MainForm.vb in your old project and select it
6) Repeat steps 4 and 5 for each form you added to the project.

muratguenduez

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: TCP comError stops in several minutes after start the program
« Reply #11 on: October 28, 2017, 05:40:29 AM »
im using c#.  just forms ?? i dont think so. there are option under the solution tree. AdvancedHMI and AdvancedHMIcs. i right-clicked on  AdvancedHMIcs and i selected all my woks as form.cs ( not form.designer.cs right ? )
and when i try to run or build i have many errors. first of all i have tried like this and then  i wrote the problem here =)

otherwise, i think i need to copy that form.designer.cs so how will it understand about design materials??
secondly, i have some pictures for pictureboxes as resources
...

doesnt works, dont recognised all labels, drivers, modbuses....
« Last Edit: October 28, 2017, 06:07:17 AM by muratguenduez »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: TCP comError stops in several minutes after start the program
« Reply #12 on: October 28, 2017, 07:18:50 AM »
You should not have to select the designer files. Once you select the form file, VS should automatically grab the designer file. That is why you can only select one at a time, otherwise it will not grab the designer file. If you have resources, you will need to also add that back to the project.

Since you are using c#, this may be an easier way:

1) Download and extract version 3.99x
2) Replace the AdvancedHMIcs folder with the same folder from your previous project
3) Open 3.99x in Visual Studio
4) Build the solution

This is similar to what you did previously, except you do not have to delete the project and add existing within VS.

After you build the project, use Windows Explorer to check the properties of the DLL files that are with the executable to see if they are version 3.9.24
« Last Edit: October 28, 2017, 07:23:16 AM by Archie »

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: TCP comError stops in several minutes after start the program
« Reply #13 on: October 29, 2017, 09:08:01 PM »
I also tried to replicate this with a fresh copy of 3.99x.

The counter just keeps on going long before connecting and even long after disconnecting from ModRSSim simulator.

muratguenduez

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: TCP comError stops in several minutes after start the program
« Reply #14 on: October 30, 2017, 02:39:57 AM »
You should not have to select the designer files. Once you select the form file, VS should automatically grab the designer file. That is why you can only select one at a time, otherwise it will not grab the designer file. If you have resources, you will need to also add that back to the project.

Since you are using c#, this may be an easier way:

1) Download and extract version 3.99x
2) Replace the AdvancedHMIcs folder with the same folder from your previous project
3) Open 3.99x in Visual Studio
4) Build the solution

This is similar to what you did previously, except you do not have to delete the project and add existing within VS.

After you build the project, use Windows Explorer to check the properties of the DLL files that are with the executable to see if they are version 3.9.24

with this way;
1) Download and extract version 3.99x
2) Replace the AdvancedHMIcs folder with the same folder from your previous project
3) Open 3.99x in Visual Studio
4) Build the solution
its ok i have no error after build or trying to open any form. =) i delete the folder AdvancedHMIcs in 3.99x then i copied my folder AdvancedHMIcs then builded everything is good. thanks Archie.

but my problem is same. it stoped at 83 now. atherwise i tried in vs mode

error event never works.