Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - usapatriotforlife

Pages: [1] 2 3
1
Hi, Archie,

I have determined through testing that when a BasicLabel loses connection to a PLC that its displayed text alternates between the last value it was able to read and an error messages such as "Unable to connect to xxx".  I never implemented the textchanged event, I just watched the basiclabel displayed text switch back and forth in my program.  So, if what is visually changing on the screen is truly just a "display" and not the underlying value in the text property then comparing value to text would work.

The PLC programmer is going to design an incrementing counter for me to check.  If I read the counter and see that it isn't incrementing then I'll know that the PLC is offline or having issues.  I've also built a timer to ping the PLC every 30 seconds.  If the code can ping the plc, the timer sets DisableSubscriptions to False.  If not, it sets DisableSubscriptions to true.

My two cents are that I feel like the BasicLabel "knows" when it can't read data and ought to be able to set a property indicating no value was read last time, but I'm not complaining because AHMI already does so much and is so awesome.


Any and all advice is very much appreciated. 

Ken Sumrall

2
Hi, Archie,

Thank you for that idea.  Going off of what you suggested, since I have a timer that runs every 5 seconds to poll the values of each basiclabel for a particular PLC, can I assume that each and every time I check a basiclabel that value and text would be equal if the PLC was read successfully and not equal if there was an error reading the PLC tag?  Following this train of thought, maybe I should just read the text property and perform error checking.  What do you suggest?  I will run some tests to see if value = text on good reads, but your insight in to whether this is consistent or advisable to do would be greatly appreciated.

Thanks for this awesome product and the time you put in to it.

Ken Sumrall

3
Hello, Archie,

When using an AdvancedHMIControls.BasicLabel attached to an AdvancedHMIDrivers.EthernetIPforCLXcom using version AHMI 3.99e over an unreliable Ethernet connection, I sometimes see in the BasicLabel a message about "Timed Out reading ...." or "Unable to connect to ....". 

I understand that I can suppress these messages by setting the BasicLabel object property "SuppressErrorDisplay" to true, but what I'm looking for is a way to know that an error occurred when reading the PLC tag the last time around.  From my testing, it appears that during these errored times, if I were to check the value of the BasicLabel in question, it would be the value of the last successful read.  I do not see a property or event helping me to know that an error occurred during the last PLC tag read attempt.  I feel that I must be overlooking something because this would be such a basic thing to have and to know.

So, the question is, how can I tell when the last read of a tag failed?

Just a bit more info:  I have multiple BasicLabels that read various tags from the PLC.  Not all will fail, just some based on I guess some sort of randomness in the poll rate cycles.  I'm interested in knowing when a specific object, in this case a BasicLabel, was unable to read the tag at the last poll time.

Thanks!

Ken Sumrall


4
Ok, thank you.

5
Do any of the AHMI users on here have any suggestions, tips, or tricks for a newbie like me on how to make my projects easier to upgrade when a new AHMI version comes out?  I've got one project still running v3.41 because I just don't have the time or patience to convert it to a newer version. 

I'm trying to make my newer projects as modular as possible. 

I've started doing stuff like this:

Code: [Select]
### The click event for some Advanced HMI Object ###
sub hmiobject_clicked(sender as .....) handles events xxxxxx
  call mycustom_hmiobject_clicked(sender)
end sub

where I only put a single line in the click event code that calls a subroutine that does all the work.  I put that subroutine in a separate file for portability.

The biggest work to be done when upgrading to a newer version is rebuilding the form and adding all of the objects.  How do y'all handle that?  I've tried cutting and pasting the auto generated code with limited good results.

6
Sometimes on this forum, I see links to zipped VB patch files for a particular driver or component.  (Example: http://advancedhmi.com/forum/index.php?topic=188.msg615#msg615) This has me wondering if there is a browseable list of these patches posted somewhere around here.

Along these same lines, I was wondering how to tell when a new version of a meter pack that I have purchased is released.

Thanks for everything you do with regards to Advanced HMI and supporting it like you do.

7
Thank you very much. 

8
CORRECTION!!!  I need to correct my question to state that the exception is happening at line # 825, not at line #816.  It is the same subroutine call, just a few lines further down.

Is it still okay to comment out this line?

Also, I like to see error messages show up in my value fields.  Commenting out line # 825 won't change that will it?

Thanks!

9
I have an application that closes using "me.close()" during a timer tick event.  (In a nutshell, the program is run every 5 minutes using windows task scheduler.  It runs, collects data, writes to a SQL database, and then closes after 30 seconds using a timer tick event.)

What I have noticed is that about a third of the times, I get an ArgumentOutOfRangeException in EthernetIPforCLXcom.vb at m_synchronizingobject.begininvoke(SubscriptionList(i), z).  (EthernetIPforCLXcom.vb , Line #816, advanced version 3.5.7)

All my data is written to the SQL database, so I'm thinking that the exception happens inside the internal workings of "me.close()" which is the last line in that subroutine.  The exception doesn't cause me any major problems, other than an exception error, but I'm wondering if there is a better way to manually close down advancedhmi applications. 

Example Screen Shot:



10
Support Questions / Re: How To Emulate a Momentary Button
« on: September 25, 2013, 08:54:38 PM »
Archie,

Your suggestion worked perfectly.  Thank you so much for all of your help.

11
Support Questions / Re: How To Emulate a Momentary Button
« on: September 24, 2013, 07:17:42 AM »
Thank you. I will try that today. 

12
Support Questions / How To Emulate a Momentary Button
« on: September 24, 2013, 12:21:36 AM »
I have an address called "Alarms_Clear_DAQ" in a PLC.  When I view the PLCAddressValue in a basic label it shows as "FALSE".  The PLC is programmed to clear an alarm bit in another register when Alarms_Clear_DAQ is momentarily set and then cleared.  Everything works as expected if I put a MomentaryButton on to my form, make sure output type is set to "MomentarySet", put "Alarms_Clear_DAQ" for the PLCAddressClick value, and then click the MomentaryButton with the mouse.

However, I want to simulate clearing that value in code and not with a button that has to be clicked.  What is the best way to simulate a Momentary button in code?  Thanks.

(I've tried using a basiclabel with PLCAddressValue set to "Alarms_Clear_DAQ" and a timer control set to 300 ms.  I thought I could just set "basiclable1.value = "True" and then after the timer "ticked", set it back to "False", but that didn't work in my testing.)

13
Very interesting results: With "disablesubscriptions" set to true at design time and the change you suggested, the exception is thrown the first time through, then at what appears to be the next polling cycle, PLC values start to flow in and the exception is not thrown again.  Thanks for helping me with this. 

14
I have an program that displays PLC values on multiple tab pages of a .net tabcontrol.  I have noticed that advancedhmi components on unviewed tab pages do not receive data from the plc.  Or, to be as accurate as possible, I have noticed that the "valuechanged" event for an advancedhmi control will not fire on unviewed tab pages. 

I believe that this could be related to the comment posted at the top of the every advanced hmi form that reads:

Quote
    '*******************************************************************************
    '* Stop polling when the form is not visible in order to reduce communications
    '* Copy this section of code to every new form created
    '*******************************************************************************


Of course the associated code for that visiblechanged event deals with the form, but I figure that something very similar is happening for the other controls.  Digging through the code, I see lots of places where the component's visibility is checked to determine how to handle various events.

The workaround that I have come up with is in my formload event to manually select each tab like this:

Quote
        TabControl1.SelectTab(2)
        TabControl1.SelectTab(1)
        TabControl1.SelectTab(0)


But this just doesn't seem like the best way to deal with this.  Is there a better way?  And even more so, I would like to poll regardless of visibility.  A lot of what I do is database related where I take the PLC values and store them in SQL Server.  In these cases, the form does not need to be visible at all and I don't want to ever take the chance that the program is not getting PLC information.

As a side note, the method that you use in the visiblechanged event is to disable subscriptions on the AdvancedHMIDrivers.IComComponent class object.  Is this the same as disabling subscriptions of the Ethernet IP Comm driver object?  I ask, because I've noticed that setting this property to true for the IP Comm driver, in other words, subscriptions are disabled, does not stop plc messages from flowing in to advancedhmi for controls that already have existing subscriptions.

Thanks for building this wonderful HMI tool kit and for making it free!!  It is really an awesome group of controls.


15
Hi, thank you for the clarification, Archie.  Since I can disable subscriptions for the IP comm driver during design time and I still see data flowing in to AdvancedHMI components also created at design time, I'm guessing that design time component subscriptions are added to the driver's queue irregardless of its disable subscriptions property.

I need a way to pause all I/O activity through a PLC Comm driver if a network problem is detected with its associated PLC.  I'm thinking that I ought to be able to figure out how to cycle through all the subscriptions associated with the PLC Comm driver and remove them manually.  Is there another method I can use that's already built?  For instance, a method that does this already when the program is shutting down?

PS:  This thread has morphed in to more of a support Q&A thread.  Do you want me to start over in the "Support Questions" group?

Pages: [1] 2 3