Author Topic: multiple outputs on one button  (Read 8759 times)

BLUDOTT

  • Newbie
  • *
  • Posts: 9
    • View Profile
multiple outputs on one button
« on: October 27, 2016, 12:51:23 AM »
is there a way to make one button in advanced hmi control 2 to 3 outputs, like for example one pilot light can control 3 internal relays or read ?

Rox

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: multiple outputs on one button
« Reply #1 on: October 27, 2016, 01:00:12 AM »
here's sample: in every press of a button increment a counter in plc,
if counter = 0 then all off
  elseif counter = 1 then On Output 1
  elseif counter = 2 then ON output 2
  elseif counter = 3 then ON Output 3
if counter > 3 then counter = 0

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: multiple outputs on one button
« Reply #2 on: October 27, 2016, 09:32:45 AM »
There are 2 possible ways to perform multiple actions with a single press of a button:

1) Create these actions in your PLC ladder logic. Your ladder logic could control output relays directly or indirectly (attached is a picture showing simple example for ladder logic).

2) In the AdvancedHMI, write the code inside the Click event to perform these actions. In addition, you could use button properties for one of the addresses.

If you double-click the button it will take you to button's Click event, where you can add code similar to this:

Code: [Select]
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        SerialDF1forSLCMicroCom1.Write("B3:0/0", "1")
        SerialDF1forSLCMicroCom1.Write("B3:0/3", "1")
        SerialDF1forSLCMicroCom1.Write("N7:0", "225")
        SerialDF1forSLCMicroCom1.Read("N7:1")
    End Sub


My suggestion: Don't use a code to write directly to Inputs or Outputs of your PLC. Setup your ladder logic instead.
« Last Edit: October 27, 2016, 05:22:20 PM by Godra »

BLUDOTT

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: multiple outputs on one button
« Reply #3 on: October 27, 2016, 11:01:16 PM »
i guess what i was trying to ask is can the PLCAdressValue take 2 plc modbus adresses ?

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: multiple outputs on one button
« Reply #4 on: October 28, 2016, 03:29:15 PM »
From my knowledge, the answer to your question is NO.

You can still achieve the same functionality by following the suggestions from previous post.

BLUDOTT

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: multiple outputs on one button
« Reply #5 on: October 28, 2016, 08:20:59 PM »
ok thanks

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: multiple outputs on one button
« Reply #6 on: October 29, 2016, 07:43:52 PM »
You might check this new control to see if it could be useful:

http://advancedhmi.com/forum/index.php?topic=1503.0

BLUDOTT

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: multiple outputs on one button
« Reply #7 on: November 04, 2016, 12:38:20 AM »
thank you Godra

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: multiple outputs on one button
« Reply #8 on: March 01, 2017, 06:55:42 AM »
Version 3.99v now includes a RecipeButton that can write multiple values on a single click. These values are defined by an INI File. The file contents would be similar to this:

[Button1]
N7:0=99
N7:1=111
N7:2=222
ButtonText=ABC

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: multiple outputs on one button
« Reply #9 on: March 01, 2017, 09:34:54 AM »
"RECIPE" button is what it is designed for. 
I would oppose for its use to control several real world outputs.
If you want to use it, one should pay dear attention to it, especially since it's  in the ini format, anybody can change/add to it.
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: multiple outputs on one button
« Reply #10 on: March 03, 2017, 03:38:17 PM »
Sorry if I am bringing up an old issue, but with the recipe button is there a way for the operator to name or rename a recipe listed in the inifile?

 I couldn't find any posts that related to this.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: multiple outputs on one button
« Reply #11 on: March 03, 2017, 06:02:03 PM »
Sorry if I am bringing up an old issue, but with the recipe button is there a way for the operator to name or rename a recipe listed in the inifile?
The text on the button is defined by the ButtonText setting in the INI file at start up:

[Button1]
N7:0=99
N7:1=111
N7:2=222
ButtonText=ABC


If you want the ability to change it at run time, it would require some code to do it.

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: multiple outputs on one button
« Reply #12 on: March 03, 2017, 06:09:10 PM »
Archie,

I don't mean the text on the button - that is going to say "Recipe"

I mean:
Recipe #1 = Delta Electronics
Recipe #2 = Omega Engineering
Recipe #3 = Beta Instruments
Reci....

If they stop doing the Omega job and want to use Recipe #2 now for a new 'Sigma Works' job can the operator change that name which is in RecipeValues1.txt?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: multiple outputs on one button
« Reply #13 on: March 03, 2017, 06:29:50 PM »
I may not still completely understand. The idea behind the recipe button is to have multiple recipe buttons on a form. Each defined with their own set of parameters and name. For example, add 3 RecipeButtons to the form. Set the IniFileSection property of each button to "Button1", "Button2", and "Button3" respectively.

Then your INI file would contain something like this:

[Button1]
N7:0=99
N7:1=111
ButtonText=Delta
[Button2]
N7:0=22
N7:1=123
ButtonText=Omega
[Button3]
N7:0=44
N7:1=789
ButtonText=Beta

When the operator is ready to change to Omega, he clicks the second button with the Omega text and it will download the associated parameters.

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: multiple outputs on one button
« Reply #14 on: March 03, 2017, 07:32:15 PM »
I was thinking the recipe button dropped down a list of recipes to select, but now I would need 255 recipe buttons if I read that correctly.

Each recipe will have 35 integers to write along with a name to display for it is what I was planning on.

Is there another function that would be better than the recipe button?