Author Topic: 3.61 flickering components  (Read 3536 times)

Friedrich

  • Newbie
  • *
  • Posts: 19
    • View Profile
3.61 flickering components
« on: June 30, 2014, 03:25:29 PM »
I've got a problem with some basic indicators/basic buttons that flicker everytime the program reads from the PLC.
I've assigned "PLCAdressVisible" to the buttons, and "PLCAdressSelectColor" to the indicators. All other adresses/options are left blank.
I've read the other threads about people having the same problem, but with pilot lights.
Therefore I have enabled "DoubleBuffered", and the only difference with it enabled is that all the buttons and indicators blinks all at once, instead of each one blinking as they are being read from the PLC.


This is what I'm reading from the PLC and presenting on the MainForm:
B3:0/0 -> B3:0/5
B3:10/0 -> B3:10/5
B3:20/0 -> B3:20/5 (Flickering)
B3:30/0 -> B3:30/5 (Flickering)
B3:40/0 -> B3:40/5
B3:50/0 -> B3:50/5 (Flickering)
B3:60/0 -> B3:60/5
B3:190/0 -> B3:190/6
B3:200/0 -> B3:200/3
B3:213/0
N7:0 -> N7:6

If I try to read any of the bits above that are marked with flickering, every indicator that is true or every button that is "visible" starts flickering.
If I remove them everything is fine. Doesn't matter if I just read one bit, or any one of those.

If I add any of them to another form, all is fine. Even when I open that form and have the main form visible in the background.

This is what I've tried/doublechecked so far without any success:
1. Changing PollRateOverride to increase time between reads (btw, it can't be set back to 0 once you've changed it)
2. All the bits being read are configured in the PLC
3. The bits doesn't flicker in RSLogix 500
4. Tried running the program on a panel-pc with a fresh installation of XP embedded
5. Removed the sub that makes the form stop polling when it's not visible
6. Instead of copying components with the troublesome bit-reading, I've added new.
7. Disabled FIFO-buffering on the comport.
8. Forced the program to use only one core of the CPU.
9. Rebuilt the solution
10. Made a new project and just added 3 basic indicators. 2 that read B3:20/3 and B3:30/3, and the last one with visibility if B3:190/0 is true.

If I don't read any bits from B3:0, I can read from B3:20 without any flickering. But I cannot read from B3:20 and B3:30 at the same time. Not even if I remove all readings from all other words.

Everytime the indicators/buttons flicker, Visual studio spams the output with this:
A first chance exception of type 'System.IndexOutOfRangeException' occurred in AdvancedHMIDrivers.dll

My setup:
Win7 pro
Visual studio express 2013
AdvancedHMI 3.61 beta
SLC 5/03 via DF1 (RS232 cable)

Friedrich

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: 3.61 flickering components
« Reply #1 on: July 04, 2014, 12:07:30 PM »
Did some more testing without any result:

1. Disabled hyperthreading on the cpu (had issues with it with other software and serial com.)
2. Changed the reading of the bits from B3:0/0 to B3:0/00
3. Changed the reading of the bits from B3:0/0 to B3/0
4. Disabled subscriptions on DF1Comm1
5. Installed and compiled the program in Visual Basic 2010 Express

I was going try with an older version of AdvancedHMI, but the downloads from Sourceforge doesn't work today.
I'll check if I can get my hands on another PLC and try with that.

Friedrich

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: 3.61 flickering components
« Reply #2 on: July 05, 2014, 12:50:27 PM »
Did even more testing today, without any result:

1. Tested the new version 3.62
2. Tested all old versions available on Sourceforge
3. Upgraded Visual Basic PowerPack from v10 to v12.
4. Added/declared all missing bits in every word in the PLC (I had only declared bit 1-8 in B3:20 for example, so I added the rest)
5. Changed the settings of the com port in Windows to match the settings of DF1Comm.

None of the above worked either.

But I found what is causing the problem
If I add 3 basic indicators and assign them B3:20/0, B3:30/0 and B3:50/0, it will generate "A first chance exception of type 'System.IndexOutOfRangeException' occurred in AdvancedHMIDrivers.dll".
If I add a fourth basic indicator and assign it B3:40/0, it will stop generating the error.
So I fiddled some more, and found that the magic limit is when you try read something that is 20 words or more apart. And it doesn't matter if it's B3:20/0, B3:30/0 and B3:50/0 - or B3:40/0, B3:50/0 and B3:70/0. As long as the bits are more then 20 words apart it will generate the error "IndexOutOfRangeException" and components that are assigned a bit to be visible will flicker.

Now that I know what is causing the problem, I can work my way around the problem  :D

I found another thing as well. If the DF1Comm baudrate is set to auto, there will be some errors generated:
The thread 0x23ec has exited with code 259 (0x103).
The thread 0x92c has exited with code 259 (0x103).
The thread 0x239c has exited with code 259 (0x103).
The thread 0x20d4 has exited with code 259 (0x103).


If you change it to 19200 (which is what my PLC is set to) there won't be any errors.

To Archie; Hats off for making this fantastic product! Is there a way to make a donation?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: 3.61 flickering components
« Reply #3 on: August 05, 2014, 09:32:06 AM »
Thank you for the detailed report of this problem. It seems as if there is something wrong in the optimizing code. The driver attempts to group multiple reads into one packet to improve performance and I think the span is up to 20 elements. I will look into this and see if I can correct the problem in a future release.

Friedrich

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: 3.61 flickering components
« Reply #4 on: August 26, 2014, 05:50:19 PM »
No problem, just glad I could help. Better make it clear what you have tried, so someone else doesn't waste time trying the same things. Sounds like you know what the problem is now, that's a good starting point for solving it :)
Once I worked my way around the problem everything worked just fine.
This was my first time programming Allen Bradley and vb.net. It's been over 10 years since I last programmed in ladder, and computer programming isn't my main profession so to speak. But once again I must say that you have made a really nice job with AdvancedHMI. Really easy to learn and use, and gives you the power to do what you want in comparisson to propriatery software for propriatery displays.
I'll try and put put the program under Application showcase when I get the time.
There's just one thing missing in AdnvancedHMI, and that is a proper alarm list-component. That would be really nice!

ErnieAd

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: 3.61 flickering components
« Reply #5 on: April 13, 2015, 08:03:36 PM »
Hi!
This is my first post and we are new to HMIAdvanced doing our first project with it and we are impressed.

We are getting the same Output several times with different thread as outlined above while we are using the Modbus protocol with an AutomationDirect PLC - i.e.:
                   - "The thread 0x.... has exited with code 259 (0x103)."
Is there a troubleshooting guide for this or has there been a work around?

Many thanks!
Ernie Adsett
TechCold International

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: 3.61 flickering components
« Reply #6 on: April 13, 2015, 09:57:22 PM »
We are getting the same Output several times with different thread as outlined above while we are using the Modbus protocol with an AutomationDirect PLC - i.e.:
                   - "The thread 0x.... has exited with code 259 (0x103)."
Is there a troubleshooting guide for this or has there been a work around?
This is only an informational message. You can suppress those messages as described here:

http://www.vbforums.com/showthread.php?639611-RESOLVED-Disable-visual-studio-from-displaying-quot-The-thread-lt-No-Name-gt-%280x1e24%29-has-exited-quot