Author Topic: Additional Pages fail to communicate with the PLC  (Read 6220 times)

StevieG

  • Newbie
  • *
  • Posts: 9
    • View Profile
Additional Pages fail to communicate with the PLC
« on: September 28, 2016, 08:47:08 AM »
I have created a second page to my project with the 'change form button' which works fine, I am able to toggle between pages 1 and 2 with no difficulty. The problem I am having is that I am unable to gain communication to the buttons on the second page from the PLC.
I have tried the same buttons (tested with the digital panel meter) on the first page with no problem, the comm component,  the plc address ComPort, the communication is ok, but when the components are loaded onto the second page I am unable to achieve communication with the PLC.
I have tried different switches, meters etc and different addresses, I am using the correct communication DF1Com1 via RS232.
Any ideas I would be really grateful
 
Thanks
 
Steve
ps. I would like to thank Archie for a great program.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Additional Pages fail to communicate with the PLC
« Reply #1 on: September 28, 2016, 08:52:02 AM »
If you are using version 3.99r, the SerialDF1 driver will have an EnableLogging property. Set that True for all the driver instances. Then run the app to where you get the problem and post the resulting SerialLogFile.txt


Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Additional Pages fail to communicate with the PLC
« Reply #2 on: September 28, 2016, 11:36:21 AM »
StevieG,

Are you connecting to a physical PLC or a simulator?

StevieG

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Additional Pages fail to communicate with the PLC
« Reply #3 on: September 28, 2016, 11:49:04 AM »
Hi Archie, I am using version 399d, I have been unable as of yet to migrate over to the newer version, I am still tackling that option, I have read on here your method of upgrading and adding a project to the newer version, it does seem to be a bit tricky clearing the faults.  Do I need to upgrade to the newer version in order to have a 2nd page running.

Hi Godra, I am connecting to an AB SLC 5/04 via the RS232 terminal

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Additional Pages fail to communicate with the PLC
« Reply #4 on: September 28, 2016, 11:58:03 AM »
StevieG,

You can always download the latest version of AHMI for testing.

Keep your project as it is and just copy over the AdvancedHMI folder to the new version (test it and see of how many errors might appear).

StevieG

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Additional Pages fail to communicate with the PLC
« Reply #5 on: September 28, 2016, 10:45:44 PM »
I have upgraded to the latest version 3.99r (from version 3.99d) and I am finding these errors, I would be grateful if you could point me in the right direction in clearing there errors,

thanks.  Steve

Error   BC30590   Event 'Click' cannot be found.   

Error   BC30002   Type 'AdvancedHMIDrivers.DF1Com' is not defined.   

Error   BC30002   Type 'AdvancedHMIControls.DateTime' is not defined.   

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Additional Pages fail to communicate with the PLC
« Reply #6 on: September 28, 2016, 11:33:59 PM »
Double click the 2nd error and change DF1Com to SerialDF1ForSlcMicroCom

Double click the 3rd error and change DateTime to DateTimeDisplay


Not sure about the 1st error. Will have to see more details on it.

StevieG

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Additional Pages fail to communicate with the PLC
« Reply #7 on: September 29, 2016, 10:15:40 PM »
Hi Archie, thanks very much for your support, I have successfully corrected the errors with your suggestion, although 89 errors have also occurred. The main errors are the 'CommComponent' attributed to each basic label, so if I could understand what is going on with the first ones I'm sure I'll be able to rectify the others.

BC30456 - 'CommComponent' is not a member of 'AnimatingPictureBox'.
BC30456 - 'CommComponent' is not a member of 'DigitalPanelMeter'.
BC30456 - 'CommComponent' is not a member of 'DigitalPanelMeter'.

BC30456 - 'ChecksumOptions' is not a member of 'DF1Transport'.
BC30456 - 'SynchronizingObject' is not a member of 'SerialDF1forSLCMicroCom'.
BC30456 - 'OutputType' is not a member of 'SelectorSwitch3Pos'.
BC30506    - Handles clause requires a WithEvents variable defined in the containing type or one of its base types.

Unfortunately I do not have enough experience with VB for me to rectify the faults alone

Thanks again

Steve


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Additional Pages fail to communicate with the PLC
« Reply #8 on: September 29, 2016, 10:25:06 PM »
Do a Search and replace of CommComponent with ComComponent

Delete the references to SynchronizingObject

StevieG

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Additional Pages fail to communicate with the PLC
« Reply #9 on: October 01, 2016, 01:29:49 AM »
Thanks Archie for your support, I did exactly as your instructions, I also deleted checksumoptions and outputtype, this allowed me to start the program without any errors. I was then able to connect to the PLC and gained communication, then for some reason, after I disconnected to I have been unable to gain communication again, when I attempt to connect I can see the Rx/Tx LED's flash on the Null modem connected to the PLC but no data transfer. Again any suggestions I would be very grateful

Thanks again Archie.

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Additional Pages fail to communicate with the PLC
« Reply #10 on: October 01, 2016, 06:26:20 PM »
For a test, using the latest version of AHMI, you could create a clean new project and add the driver and 1 or more controls on each form.

StevieG

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Additional Pages fail to communicate with the PLC
« Reply #11 on: October 02, 2016, 05:52:07 AM »
Thanks Godra I'll give that a go, all positive results I'll post here.

StevieG

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Additional Pages fail to communicate with the PLC
« Reply #12 on: October 02, 2016, 08:34:25 PM »
Hi Archie, Godra. I have given it a go with a clean project, the first page has no problem in sending/receiving values. The 2nd page the Digital Panel Meter indicates that there is no response from the PLC. The driver is exactly the same as for page 1, SerialDF1forPLC5Com1, with the same settings.

I have attached the Serial Log File as requested. (the date was too large for this post)

Thanks again for your help.

Steve

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Additional Pages fail to communicate with the PLC
« Reply #13 on: October 03, 2016, 02:48:06 AM »
This one is being a tricky one. I did notice in the log file that the data is only coming in at 1 or 2 bytes at a time. I thought this was the problem because I recently found a rare situation where if a byte value of 16 is returned and the packet splits right there, it will fail the checksum. But looking further into the file, I do see it is trying to open COM5 a second time which I'm guessing is when the second page opens. We did find a similar issue when using RSEmulate and there is a fix in the next version. Maybe this is the same thing causing the problem you are having.

When I get back to the office on Tuesday, I will test a patch to version 3.99r to see if it fixes the problem of trying to open the COM port twice. If so, I will post the patch for you to test out.

StevieG

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Additional Pages fail to communicate with the PLC
« Reply #14 on: October 03, 2016, 03:26:28 AM »
Thanks again Archie for you help, I'm away from Tuesday for 2 weeks, hopefully if successful I can try out the patch when I'm back.