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.


Topics - usapatriotforlife

Pages: [1]
1
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


2
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.

3
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.

4
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:



5
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.)

6
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.


7
I would definitely appreciate it if someone would post a short code section showing how to asynchronously read three or four registers on a PLC using a datasubscriber object connected to a one of the ethernet comm drivers.  I'm completely confused on how to add the registers, say for a SLCMicro of N17:0, N17:1, B16:0/0 and then how to add the event handlers when data comes back.  Thanks in advance. 

8
Open Discussion / What controls are there that I don't know about?
« on: August 23, 2013, 12:34:49 AM »
I purchased the Meter Pack 1 expansion pack and love it.  Then I read a thread where you discussed a FAN control that is available to those who take your class.  This got me to wondering what other controls are out there that we don't know about and if you'll ever put them in another expansion pack for purchase.  I hope so!

9
I have an advanced HMI 357 solution with three meters and 3 pilot lights and 1 PLCSLCMicroCom ethernet driver.  The pilot lights are set to "ENABLED=FALSE" and are not associated with any PLC driver.  The three meters all point to a single address of "N17:0".

I have noticed that it takes up to 30 seconds for the program window to display when running the program.  This happens in both "build" and "release" mode. It happens when I run the program from windows explorer or from within the VS2012.

I don't know if it has anything to do with it, but I notice the following message will appear multiple times in the debugger when the program exhibits this behavior:

The thread 'SendQueProcessor' (0x15c) has exited with code 0 (0x0).  (It always exits with a 0 code, but of course the thread ID is not 0x15c every time)

The other thing I noticed is that the the AdvancedHMI application starts to use up memory while it is paused and then once things settle down, the memory is released.

It is very repeatable on my system. 

  • I run the app and see the process appear in "taskmanager"
  • the process will take up around 10 to 20k of memory and there will be no window showing
  • about 30 seconds later (sometimes longer than 30 seconds, every now and then, sometimes a lot shorter than 30 seconds) the application form window will display.
  • memory utilization will jump from 20k to between 50k and 80k
  • generally the controls have a message about not being able to contact the PLC
  • in a few seconds, the controls will display the value from the PLC register
  • and at the exact same time, all that extra memory will be released and it will back down at around 20k
  • the program appears to act normally after that

Any ideas? 

Thanks!


here is the debug output of a sample run:
Quote
<PROGRAM START UP>
'AdvancedHMI.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\Ken\Documents\Visual Studio 2012\Projects\357\Development\WisPak01_AHMI.357\AdvancedHMI\bin\Release\AdvancedHMI.exe', Symbols loaded.
'AdvancedHMI.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Remoting\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Remoting.dll'
'AdvancedHMI.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'AdvancedHMI.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\Ken\Documents\Visual Studio 2012\Projects\357\Development\WisPak01_AHMI.357\AdvancedHMI\bin\Release\MfgControl.AdvancedHMI.Controls.dll'
'AdvancedHMI.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\Ken\Documents\Visual Studio 2012\Projects\357\Development\WisPak01_AHMI.357\AdvancedHMI\bin\Release\AdvancedHMIDrivers.dll', Symbols loaded.
'AdvancedHMI.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\Ken\Documents\Visual Studio 2012\Projects\357\Development\WisPak01_AHMI.357\AdvancedHMI\bin\Release\MfgControl.AdvancedHMI.Drivers.dll'
A first chance exception of type 'MfgControl.AdvancedHMI.Drivers.Common.PLCDriverException' occurred in MfgControl.AdvancedHMI.Drivers.dll
The thread 'SendQueProcessor' (0x3e0) has exited with code 0 (0x0).
A first chance exception of type 'MfgControl.AdvancedHMI.Drivers.Common.PLCDriverException' occurred in MfgControl.AdvancedHMI.Drivers.dll
The thread 'SendQueProcessor' (0x15c) has exited with code 0 (0x0).
<CLICK X TO CLOSE PROGRAM>
The thread '<No Name>' (0x28c) has exited with code 0 (0x0).
The thread '<No Name>' (0x630) has exited with code 0 (0x0).
The thread '<No Name>' (0xa4c) has exited with code 0 (0x0).

10
Support Questions / v3.5.6 cpu utilization issues??
« on: August 21, 2013, 03:10:04 AM »
It could be just me and my development platform, but I'm experiencing the following issue with v356:  I can take a brand new solution directly from the website, add a panelmeter and and an EthernetIPforPLCSLCMicroCom1 driver.  Set the PLC Address value and the IP address in the control, build and run and my cpu goes to about 40% and stays their as long as the program is running.  If I add a couple of these drivers, the CPU pegs at 100%.  Also, data doesn't seem to read in as snappy in this release.

I tried the identical setting with a version 341 of AHMI and the cpu barely budged on my computer. 

I get the same results copying the files out and running them on a different workstation from my dev computer as well.

Any ideas on what to try to fix this?  Thanks!

11
I'm using Advanced HMI's ModbusTCP driver (v341) to connect to a VLINK MESR911 Module which in turn is connected RS-232 to a Badger M-5000 flow meter.  (The purpose of the MESR911 is to convert Modbus TCP to Modbus Serial.)

Software supplied by Badger running on my laptop is able to read the M-5000 when connected directly to the M-5000 with the serial cable.

However, depending on what address I attempt to read, I get "Illegal Modbus Function" or "Invalid Modbus Address" errors when using the AdvancedHMI ModbusTCP driver connected to the MESR911.

I want to read the following Modbus address: 30541.  When I do, I get Invalid Modbus Address displayed in the advancedhmi control.  As I mentioned, attempted reads of other addresses will return Illegal Modbus Function or Invalid Modbus Address. 

I have found through experimentation that I can read modbus address "40001" successfully.  Well, at least AdvancedHMI controls display a "2" when I read that address instead of an error.  :)

I've done lots and lots of trouble shooting.  The config for the MESR911 is very simple and I've been through it all making changes just to see what would happen.  Any deviation from what I think should be the proper config yields COMM ERRORS or similar AdvancedHMI type responses.  I've changed the Modbus UnitID in the M-5000 and have witnessed AdvancedHMI complain about that.  Changing the unitid value in the ModbusTCP driver to match the meter setting corrects the problem.  So I feel that I'm getting through to the Meter using AdvancedHMI.

The address 40001 that I believe that I'm able to read is a UINT 16.  The value that I want to read is a FLOAT32 at address 30541.  However, other UINT 16 address fail to read as well.  I don't know if being able to read 40001 is significant and if I'm having an offset issue, though I can't read any 30001 or 10001 or 00001 addresses.

I noticed that the AdvancedHMI modbusTCP driver is described as Alpha software at this time.  I'm wondering if the driver is causing the problem or if it's something that I'm missing or doing wrong.

Any help and advice would be appreciated. 


12
I have a need to access via the Ethernet TCP drive a PLC on a port other than the fixed port 0xAF12 that is hard coded in the Data Link Layer.  I respectfully request the ability to specify the port value in the comm control properties or via a set property method.  Thank you!

13
Support Questions / Can I specify port in Ethernet Comm Control?
« on: August 01, 2013, 02:44:03 PM »
Hi, is it possible to specify the port number that an ethernet comm control uses when connecting to a PLC?

I looked at the control, but couldn't see how to do this.  I tried adding ":" and the alternate port to the end of the IP address and that did not work.

Thanks!

Pages: [1]