Author Topic: Project crashed overnight  (Read 10885 times)

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Project crashed overnight
« Reply #15 on: July 11, 2015, 07:51:43 PM »
Godra,

Thanks, I deleted the 2nd DF1 on form 11 & changed all reads to DF1Com1.

I checked the properties on DF1 on all forms & disabled the data subscriptions - didn't know about that.

I accidentally typed in the wrong spot in MainForm properties & changed the name to 'k', just never bothered changing it back until now. I knew I would have to rebuild after the name change & then check the properties on the home button on all other screens.

My current project does have a Home button on every  form - I think at the time I zipped the project the I was getting a FormChangeButton error & the forms were appearing without any buttons, so I was adding them back. (On some forms the Home button is larger & a different color).

I saw earlier the 2 MessageByValue's stacked on form 12 & deleted the copy already.

The only thing I can't do now (I'm home & don't have the PLC here) is test the messages to make sure they work - still keep getting "Undefined Message For 0" every time I open either form 5 or 7. Forms 12 & 13 have small collections so I'm not using a .txt file as an INI file - just the collection entries.

If the messages work Monday I can finish this & reinstall an HMI - the unit has been running in a "Manual Bypass HMI" mode since the old computer running PanelmatePC fried the motherboard & the IT Dep't damaged the hard drive's booting trying to get a new computer to work, and could never get the SST DH+ ISA card to work - then it became my problem. (Never had a high opinion of IT Dept's ;)) Hope this is done.

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Project crashed overnight
« Reply #16 on: July 11, 2015, 09:20:41 PM »
Just to respond to what you have done and clarify why I had to do some things:

1) All together, in my opinion, you seem to be having issues with the computer and not necessary your project

2) You should enable all subscriptions for each DF1Com driver on each form (I had to disable those since the project, when run, was looking to communicate with PLC which I don't have. This way I was only testing your forms without obtaining any data from the PLC. Also see remark in point 5) as well for the testing that you might perform).

3) Changing the form name was something I did to make things simpler (I am not sure if the name "k" was affecting the project at all)

4) I did edit my previous post suggesting that I found your "Home" buttons but the AutoScroll property was not enabled on all forms and that was the reason I didn't see those buttons. You should check this AutoScroll property on every form and make changes if you need it.

5) The simplest way to test your message collections would be the following (I will use only one of your forms as example):

In the DesignMode:
--- In VS just open your Form5 and if it doesn't show as the attached picture then there is something wrong with your computer
--- Click on the MessageDisplayByValue1 and then in the Value property just keep changing numbers to see what message shows (it should show "Error" for value 0 as the picture shows, it should show "Begin" for value 1 ... etc).

To see it changing at Runtime:
--- On your Form5 click the MessageDisplayByValue and remove the PLCAddressValue (it should be N7:58 that shows currently)
--- Add NumericUpDown box to your Form5 and then double click it to get to the ValueChanged sub and just add the following code:

Me.MessageDisplayByValue1.Value = Me.NumericUpDown1.Value

Run the project and manually change the value in the NumericUpDown box.

You can currently keep all subscriptions disabled to move faster from one form to another but remember to enable them after you finish testing. Also remember to remove NumericUpDown box, remove the code/sub that was created and set the PLCAddressValue back to N7:58.
« Last Edit: July 11, 2015, 09:55:46 PM by Godra »

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Project crashed overnight
« Reply #17 on: July 12, 2015, 02:07:13 AM »
I re-enabled all subscriptions - thought you were suggesting that for the project, not testing.

Since I accidentally changed the MainForm name I wanted to change it back, just didn't until you mentioned it. So I finally did.

I don't need the Autoscroll, the pages are the size they need to be for the machine's (non-widescreen) monitor (1280x1024).

On the MessageDisplayByValue's that I have entered a collection for they are responding proper during debugging, the issue I am having (and can't test until I connect to the spare PLC with the project in it I have on my desk) is the Status messages that I have used an IniFile instead of typing in the collection. If I add a few entries in the collection those values do show the collection test message I entered (different from the IniFile message so I know which is appearing) with an empty collection it doesn't look at the IniFile.
« Last Edit: July 12, 2015, 02:09:21 AM by AabeckControls »

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Project crashed overnight
« Reply #18 on: July 12, 2015, 06:36:49 AM »
To put this project to bed I removed the StatusValues1.txt from the MessagedisplayByValue for the Step display & repopulated the collection with the 52 entries. Copied & pasted it to the other form it's on (and changed the Fore Color) and this project is now complete. Also thought that the Clock form was a little plain & missing something so I added 6 vertical meters from the Purchased Controls for the month, day, year, hour, minute & seconds. (See below)

Going to try the IniFile method later on a test PLC to figure out how to do that.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Project crashed overnight
« Reply #19 on: July 12, 2015, 07:03:42 AM »
Another recommendation if you have not done so yet. In the code behind every form, insert this code snippet:


    '*******************************************************************************
    '* Stop polling when the form is not visible in order to reduce communications
    '* Copy this section of code to every new form created
    '*******************************************************************************
    Dim NotFirstShow As Boolean
    Private Sub Form_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.VisibleChanged
        '* Do not start comms on first show in case it was set to disable in design mode
        If NotFirstShow Then
            AdvancedHMIDrivers.Utilities.StopComsOnHidden(components, Me)
        Else
            NotFirstShow = True
        End If
    End Sub



This will speed up the update rate for the forms that are visible by pausing communications when a form is hidden.

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Project crashed overnight
« Reply #20 on: July 12, 2015, 07:49:31 AM »
Archie,

That was already in the MainForm code, but I had to add it to all the other forms.

Now, what is the trick to getting the IniFileName to display the text file? I entered the lines as you showed:

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Project crashed overnight
« Reply #21 on: July 12, 2015, 07:58:31 AM »
You need to make sure the file gets copied with the executable during a Build. This is done by selecting the file in Solution Explorer, then looking in the Properties window for CopyToOutputDirectory. Change the value to CopyIfNewer

The next step is to put the name of your file in the INIFileName property of the MessageDisplayByValue

- Select the MessageDisplayByValue on your form
- In the properties window go to INIFileName
- Enter StatusValues1.txt

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Project crashed overnight
« Reply #22 on: July 12, 2015, 09:15:35 AM »
I did exactly those steps (you mentioned them before)  & when I go to the screen it always shows "Undefined message for value 0" or whatever value is current.

I tried the wholepath/filename in the IniFileName & that didn't matter.

I renamed the file removing a space (old = Status Values1.txt) but no change (did a rebuild).

I tried entering an empty collection from 0 to 51 with no messages to see if it needed that, but only displayed an empty line for all values.

I tried the file name StatusValues1 without the .txt & then got a file not found error - so it's seeing the file, it's just not using it.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Project crashed overnight
« Reply #23 on: July 12, 2015, 09:37:44 AM »
Check PLCAddressValue for your MessageDisplay to make sure you still have an address in that.

Set the Value property to 5, then run your application and see if the message changes.

If you still can't get it to work, download the sample project AdvancedHMICLXSample.xip from here:

https://sourceforge.net/projects/advancedhmi/files/advancedhmi/3.5/SampleProjects/

It has a working example of the MessageDisplayByValue using an INIFile

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Project crashed overnight
« Reply #24 on: July 12, 2015, 12:22:32 PM »
Got a test 5/04 in a rack, created a new project in RSLogix to populate all the integer & bit files. Set some of the bits read on, some of the integers used to values in range. Did a SysComms download (twice - the first time I forgot to set DF1 comms to 19200 from the default 1200). Added some EQU's N7:58 to 0 to 51, then XIC S:4/7 through 4/4 in groups to outputs so every change of N7:58 will result in a change of flash rate of an output or a change in which output is flashing. That provides me proof that N7:58 is being changed.

On form 5 I added a second MessageDisplayByValue for N7:58 but inserted the INIFileName with no collection. When programming (before & after debugging) the display with no collection always shows an error - only while debugging does it read & display the message. See attached:

The only problem is when I close debugging a long list of errors shows up for "System.ArgumentOutOfRangeException" but everything seemed OK during debugging. All forms showed the bits on I set on & the right analog value for the entries I entered.
« Last Edit: July 12, 2015, 12:30:47 PM by AabeckControls »

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Project crashed overnight
« Reply #25 on: July 12, 2015, 01:11:22 PM »
Instead of wasting the message using the txt file & put it on the MainForm with the step# & Data (dwell delay).

Degugged it for a while & a few times it paused before changing pages or the PLC outputs changed. Took up to 10 seconds after clicking on the FormChangeButton or entering the keypad value. When I exited debugging this time I didn't get the long list of errors - just a few listings in the report saying it couldn't find a file.

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Project crashed overnight
« Reply #26 on: July 12, 2015, 03:02:03 PM »
What you were describing above for "Undefined message for 0" sounds like normal control behavior to me.

The control seems to be designed to read Message collection at DesignTime and to read INI file, if specified, only at Runtime.

Archie can correct me if this is wrong.

Also, when at home and without access to a PLC, if you leave subscriptions enabled it will take long time for any action (going from form to form or entering passcode in the keypad or any other action). That was the reason I suggested to disable subscriptions while testing it at home.

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Project crashed overnight
« Reply #27 on: July 12, 2015, 05:05:38 PM »
When I was just testing it & had the long delays it was connected to a PLC in a test rack running a simple program with all the data files expanded on it so the HMI could read & write without faulting on something like Unable To Access Data File B53, etc.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Project crashed overnight
« Reply #28 on: July 12, 2015, 05:25:04 PM »
What you were describing above for "Undefined message for 0" sounds like normal control behavior to me.

The control seems to be designed to read Message collection at DesignTime and to read INI file, if specified, only at Runtime.
This is correct behavior. The INI file will not be read and the message collection populated until the application is started, therefor you cannot see the messages in Design View.

Are you seeing the delay the very first time you show any of the forms?

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Project crashed overnight
« Reply #29 on: July 12, 2015, 05:40:29 PM »
I did notice you mentioning testing 5/04 but I was more generalizing and stated "when at home and without access to a PLC".

Your project is rather graphic intensive and on my laptop computer, even with all subscriptions disabled, it would take a few seconds to draw almost any of your forms (especially Controls) and it was also a bit slow to close forms. Not that my laptop is any special (it's old 2GHz Turion64 with 4GB RAM).

Since you were experiencing delays while connected to a PLC, I would generally blame serial DF1 connection but could be something else. I did manage to set the serial speed to 38400 on my MicroLogix 1000 PLC but every now and then it still seemed a bit slow to respond.