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.


Messages - tturner

Pages: [1]
1
Support Questions / Re: Advanced HMI, BeginReadMultiple
« on: November 15, 2022, 08:11:02 AM »
That is correct, TagDataReceived is never called with the EventHandler method. Is the DataReceived method winForms dependent? I'd like to collect the tag data with the one back-end script.

2
Support Questions / Re: Advanced HMI, BeginReadMultiple
« on: November 14, 2022, 04:44:51 PM »
Good catch, but that was intentional ambiguity. I have tried it with the correct IP address. Should have clarified. 

3
Support Questions / Advanced HMI, BeginReadMultiple
« on: November 14, 2022, 08:37:32 AM »
Having a hard time with the BeginReadMultiple method when using on back end only, not coupled with winforms. I think I'm misunderstanding the use of BeginReadMultiple.

Code: [Select]
using ClxDriver.Common;
using cPLCAppCom;

namespace PLCTest
{
    class PLCinit
    {
        public EthernetIPforCLXCom plcCom = new EthernetIPforCLXCom();

        public void Config()
        {
            System.Diagnostics.Debug.WriteLine("Hello Config");
            plcCom.CIPConnectionSize = 508;
            plcCom.DisableMultiServiceRequest = false;
            plcCom.DisableSubscriptions = false;
            plcCom.IniFileName = "";
            plcCom.IniFileSection = null;
            plcCom.IPAddress = "x.x.x.x";
            plcCom.PollRateOverride = 500;
            plcCom.Port = 44818;
            plcCom.ProcessorSlot = 0;
            plcCom.RoutePath = null;
            plcCom.Timeout = 4000;
            plcCom.UseOmronRead = false;
            plcCom.DataReceived += new System.EventHandler<PlcComEventArgs>(TagDataReceived);
           
            string[] tags = new string[2];
            tags[0] = "test1";
            tags[1] = "test2";
            plcCom.BeginReadMultiple(tags);
        }

        private void TagDataReceived(object? sender, PlcComEventArgs e)
        {
            System.Diagnostics.Debug.WriteLine("Hello Data");
            string read_tags = e.Values[0];
            System.Diagnostics.Debug.WriteLine(read_tags);
        }

    }
}

Pages: [1]