Author Topic: Sample App New Multistate with Designer and import/export  (Read 18310 times)

nzflex

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Sample App New Multistate with Designer and import/export
« Reply #45 on: July 03, 2018, 04:24:22 PM »
One state at a time is fine for me :)

Phrog30

  • Guest
Re: Sample App New Multistate with Designer and import/export
« Reply #46 on: July 03, 2018, 05:21:06 PM »
If I have time later I can create a guide. It's easy.

Phrog30

  • Guest
Re: Sample App New Multistate with Designer and import/export
« Reply #47 on: July 03, 2018, 08:40:13 PM »
Here's a quick guide, it assumes you know the basics.  If you don't, do some research or ask some questions.

I downloaded the latest beta:
https://www.advancedhmi.com/forum/index.php?topic=2058.msg12401#msg12401
and merged my application with it.  The steps should be the same or close to your application.

James

« Last Edit: July 03, 2018, 08:42:05 PM by Phrog30 »

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Sample App New Multistate with Designer and import/export
« Reply #48 on: July 05, 2018, 12:02:07 AM »
There is alternative, a bit simpler way of adding these multi state controls without merging the whole project.

Some of the attached files have been modified and stripped.
You cannot benefit from Security, Audit and Database features - for these you need to follow the steps James listed.

It wouldn't surprise me if you find bugs or something that doesn't work (I think I checked all of it but...).

This is the list of files required for each control (you can add either or both controls):

BasicButtonMultistate                    Multistate
--------------------------                -------------------------

AHMIClassLibrary.dll                       AHMIClassLibrary.dll

BasicButtonMultistate.vb                Multistate.vb
ctrlBasicButton.vb                          ctrlMultiState.vb
BasicButtonDesigner.vb                  MultistateDesigner.vb
BasicButtonDesignerForm.vb          MultistateDesignerForm.vb
ColorPicker.vb                                ColorPicker.vb
AppModules.vb
Alignment.vb
Padding_Ctrl.vb
ImageSelector.vb
ResourceImages.vb

As you can see, the only common files for both controls are the dll file and ColorPicker.

These are the steps to add these controls to existing AHMI project:

1) Download the attached Resources.7z file and extract all the files
2) Right-click the AdvancedHMIControls project and click Properties, point to Resources and under Images add as Existing Item all the extracted files

3) Download the attached MultistateControls.7z file and extract all the files
4) Add a new folder to the AdvancedHMIControls\PurchasedControls folder and name it "MultistateControls"
5) Right-click this new folder, point to Add and click Existing Item
6) Browse to location of the extracted files and select AHMIClassLibrary.dll
    - once this file is added then add it as a reference to both AdvancedHMI and AdvancedHMIControls projects
7) Keep repeating step 5 for each of the files that you require from the above list (this means add them one by one)
    - don't add any files that are not in the list. All other files will be added automatically

8) Close all open forms and rebuild solution

Use the built-in Editor (designer) to manipulate the Messages.

The button control is slightly different since I chose to have the Highlight/HighlightAlternate properties be standalone and of a higher priority than either of the states back colors.
This makes the button control a sort of the quad state control.

You can use the attached Messages Import Test.txt file to test the import feature of the Multistate control.

There is even simpler way of adding the MultiState control in the reply #58, further below.

« Last Edit: May 06, 2020, 02:36:50 AM by Godra »

Phrog30

  • Guest
Re: Sample App New Multistate with Designer and import/export
« Reply #49 on: October 04, 2018, 02:10:04 PM »
Here is an updated version.  I made some major changes to alarming to speed things up.  What I noticed was after 300 or 400 alarms, the app would slow down and become choppy.  The sample app is already compiled with close to 1000 alarms, I think 980ish.  It's pretty fast now.  Start the Modbus sim, which is part of the zip file and test away.  I also made it easier to add alarms, now just add in collection.  However, it's limited to one PLC.  I didn't have time to work on multi PLC support.  Maybe one day.

I tested as best as possible, but there may be a bug or two that pops up.

https://drive.google.com/file/d/1yGLF1Vk7fS1XSQjXIKPNouUwz0J399zk/view?usp=sharing

Alpaslan

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Sample App New Multistate with Designer and import/export
« Reply #50 on: February 03, 2019, 01:02:35 AM »
Hi,

I did this procedure within document. I deleted EthernetIPforCLXCom1 because it does't exist in my system. However everytime i build project it comes back.

Ho can i get rid of it?

Edit: Now there are two of them.
« Last Edit: February 03, 2019, 03:10:46 AM by aakici »
One step at a time baby, One step at a time.

Phrog30

  • Guest
Re: Sample App New Multistate with Designer and import/export
« Reply #51 on: February 03, 2019, 07:50:53 AM »
Yeah, I'm not sure it's a bug in the data subscriber, but it's definitely annoying. What I do is comment out the code in the datasubcriber so it will no longer try and create a com component. If I have time later today I'll send a screenshot or two on how to do it.

Alpaslan

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Sample App New Multistate with Designer and import/export
« Reply #52 on: February 03, 2019, 11:06:17 AM »
Now there is six of them although i delete them. İ already searched within documents and deleted all where i found within every resx and vb document. However there are six of them. I Will look again.
One step at a time baby, One step at a time.

Phrog30

  • Guest
Re: Sample App New Multistate with Designer and import/export
« Reply #53 on: February 03, 2019, 12:11:33 PM »
Go to AdvancedHMIControls, Components, then look for DataSubscriber2.  Select it, then hit F7 to open code.  Under basic properties region, mine is line 77, comment out...
Code: [Select]
'm_ComComponent = AdvancedHMIDrivers.Utilities.GetComComponent(Me.Site.Container)

That will prevent this from happening, BUT, it will also prevent all instances from adding a com component if it needs one.  Personally, I would rather add on my own.

Alpaslan

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Sample App New Multistate with Designer and import/export
« Reply #54 on: February 03, 2019, 02:01:10 PM »
Thanks. Problem has been solved.
One step at a time baby, One step at a time.

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: Sample App New Multistate with Designer and import/export
« Reply #55 on: May 20, 2019, 03:07:06 AM »
hello
could this multistate be used with multiple registers?
as in my case now

i have 3 registers to read from
each register have multiple values

for example
the registers are d300 , d301 ,d302

the values and messages  for d300
0 = nothimng
1= openning door 1
2= alarm -
 
the states are for d301
0 = nothing
1= closing  door 1
2= alarm 2 - somthing in the way

and so on


so how can i make it happen ?

and i already add the multistate to my project using Godra way
https://www.advancedhmi.com/forum/index.php?topic=2079.msg12429#msg12429


but i don`t realy know how to use it :(






Phrog30

  • Guest
Re: Sample App New Multistate with Designer and import/export
« Reply #56 on: May 20, 2019, 09:38:44 AM »
could this multistate be used with multiple registers?
No.  That really defeats the main purpose of the multistate in my opinion.  If you use multiple connections you will need to do in code, or try one of the existing controls already in AHMI.

The multistate only shows one value at a time, so if you used multiple connections how would you pick which one is displayed. 

I think you should use alarming instead.

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: Sample App New Multistate with Designer and import/export
« Reply #57 on: May 20, 2019, 03:08:50 PM »
in this case am using 3 buttons each button when i click on it it activates one register
so it only displays one state of the registers and you can`t click on both buttons at the same time
i can do it in the code but i thought to ask if it possible to do it this way


Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Sample App New Multistate with Designer and import/export
« Reply #58 on: April 20, 2020, 12:53:26 AM »
Related to the reply #48, here is a bit simplified way of adding the MultiState control (as suggested by the user MajorFault in the topic that was removed):

1) Download the attached MultistateControls.7z file and extract all the files
2) Add a new folder to the AdvancedHMIControls\PurchasedControls folder and name it "MultistateControls"
3) Right-click this new folder, point to Add and click Existing Item, browse to the location of the extracted files and select AHMIClassLibrary.dll
    - once this file is added then add it as a reference to both AdvancedHMI and AdvancedHMIControls projects
4) Right-click this new folder, point to Add and click Existing Item, browse to the location of the extracted files and select MultiState.vb file

5) Close all open forms and rebuild solution

This is a slightly modified version of the original ctrlMultiState.vb file.
Designers are not included so you only have 2 files to deal with.

It appears to work fine.

« Last Edit: April 20, 2020, 11:37:56 PM by Godra »

Alpaslan

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Sample App New Multistate with Designer and import/export
« Reply #59 on: April 07, 2021, 04:09:27 PM »
Hi,

Over the years i am here. However i couldn't achive adding alarms to this project.

I used the editor page (ahmi_ask_1.png) but then? I stopped. There is two files Alarms.ini and Alarm_Desc.ini which i don't understand how to use them.

I connect to S7-1200 with Modbus TCP.

My alarms are bitwise. For example 40001.1 4001.2

Is there any smart man to help me?

Thanks a lot.
One step at a time baby, One step at a time.