Recent Posts

Pages: 1 ... 6 7 [8] 9 10
71
Support Questions / Re: Adding Conditions
« Last post by Archie on February 23, 2024, 10:36:41 AM »
The easiest way to do this is to use a DataSubscriber2 to watch all the variables. Then in the Datasubscriber2 code set the Visible property of the BasicButton
72
Support Questions / Adding Conditions
« Last post by Arvanoss on February 23, 2024, 10:13:47 AM »
Good Morning Everyone,

I have a program that works but I want to make the BasicButtons show and hide.
I can add PLC Addresses to the 'PLCAddressVisible' but cannot add multiple addresses.

is there a way to add additional 'PLCAddressVisible' addresses to the BasicButton code to accept multiple conditions??

I don't have PLC change permissions.

Thanks
73
Support Questions / Re: RE: Make Global Object
« Last post by Archie on February 22, 2024, 08:36:06 PM »
The IPAddress you checked, was that in the editing of the GroupedObject? Do you get an error in the BasicLabel on the grouped object?
74
Support Questions / Re: RE: Make Global Object
« Last post by zach_a_ary on February 22, 2024, 08:12:21 PM »
No and i managed to get it to pop up finally. However i still cant get it to work. i have a data type called PE. Lets just say the name was "PE1". i have several submembers such as:
.I            bool
.Blk         bool
.Clr          bool
.BlkCTU    CTU
.Name      String
etc.

under the Grouped object file, i put a basic indicator. Under PLCAddressSelectColor2 I put ".Blk"
then when i drug a grouped object to my form, under "PLCAddressUDT" i put "PE1". I made sure
the ethernet address was right and it still wont work. If i had color #2 set to green, the basic indicator
just stays green
75
Support Questions / Re: RE: Make Global Object
« Last post by Archie on February 21, 2024, 12:01:42 PM »
If you Build the Solution, do you get any errors?
76
Support Questions / RE: Make Global Object
« Last post by zach_a_ary on February 19, 2024, 11:32:21 PM »
On the original post "Make Global object" by Tazmahal, I got up to step 10 of Archies instructions but "GroupObject"
was not in my toolbox. I tried putting the downloaded file under "Controls" and then it did pop up in my toolbox but it wouldnt let me drag it down to my form. Any ideas?
77
Thanks I had been looking at how C# code is different
78
Looks like you are using VB syntax in a c# program. c# is going to be stricter with case sensitivity and type conversions.

Your code would look something more like this:

            label4.Text = (int.Parse(label3.Text) - int.Parse(BasicLabel1.Text)).ToString();
79
I'm not sure what going on but I can't seam to correct the Errors

Below is my code;

using AdvancedHMIControls;
using System;
using System.Activities.Expressions;
using System.Activities.Statements;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace AdvancedHMICS
{
    public partial class MainForm : Form
    {
        public object BasicLabel1 { get; private set; }
        public object Label2 { get; private set; }

        public MainForm()
        {
            InitializeComponent();
        }

        private void MainForm_Load(object sender, EventArgs e)
        {
        }

        private void analogValueDisplay1_Click(object sender, EventArgs e)
        {

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
       
        }

        private void OFDReader_FileOk(object sender, CancelEventArgs e)
        {
           
       

        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            Try
                Label1.Text = BasicLabel1.Text
                Label2.Text = Label1.Text - BasicLabel1.Text
            Catch ex as exception
                Label2.Text = ex.message
            End Try
        }

        private void label3_Click(object sender, EventArgs e)
        {
           
        }

        private void label2_Click(object sender, EventArgs e)
        {

        }
    }
}
80
Only the live value should be a BasicLabel. The other two will be updated via code, so they should only be of type Label.

- From the toolbox, add a Timer to the form
- Set the interval property to the time you want in milliseconds
- Set Enabled to True
- Double click the timer to get back to code
- Add code similar to this:
Code: [Select]
Try
  Label1.Text=BasicLabel1.Text
  Label2.Text=Label1.Text - BasicLabel1.Text
Catch ex as exception
  Label2.Text=ex.message
End Try
Pages: 1 ... 6 7 [8] 9 10