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.


Topics - TheColonel26

Pages: [1]
1
After upgrading to 3.99y, I am receiving this exception when calling on an address that already has one subscription. I am doing this on purpose as I have 2 different threads that share the same FINS comm object. This only happens in Mono. my current system is Debian 9.5 x64. I have tired Mono Version 4.6.2 and Mono Version 5.14.0

so if I call

_FINsCom.Subscribe("W506",1,100, a.DataReceived);
_FINsCom.Subscribe("W506",1,100, b.DataReceived); // I get an exception of System.ArgumentException: An item with the same key has already been added.

when I ran it in 5.14.0 I got the same error except "Key of 0" was tacked on to the end

stack trace is attached

EDIT:

I take that back, it is happening on the first subscription and seems to have nothing to do with multiple subscriptions.

have you used VSMonoDebugger https://github.com/GordianDotNet/VSMonoDebugger? That is what I am using for debugging my application on Mono. See My X-Server Support Issue to get X-Server support working. https://github.com/GordianDotNet/VSMonoDebugger/issues/3

I have no idea why this is happening all of a sudden, it seemed to be working fine before. I even removed all of the AHMI Projects out of my Solution, deleted them and re added them. No change.

EDIT2: I ended up doing this as a workaround, it succeeds on the second try
Code: [Select]

            int retries = 2;
            for (int i = 0; i <= retries; i++)
            {
                try
                {
                    _FINsCom.Subscribe(address, numberOfElements, pollrate, tempAS.InternalDataReceived);
                    break;
                }
                catch (ArgumentException ex) when (ex.Message.Contains("key"))
                {
                    if(i == retries)
                    {
                        Logger?.Error(ex, "AHMI Error encountered while subscribing to {Address}. Retry Limit of {retries} Has been reached", address, i, retries);
                        throw;
                    }
                    else
                    {
                        Logger?.Error(ex, "AHMI Error encountered while subscribing to {Address}. Retry {retry} of {retries}", address, i, retries);
                    }
            }

2
What is the best way to detect if communications have stopped when using the OmronFINSEthernet Driver? It seems that when you are using subscriptions there are no exceptions thrown.

I am going to do some more investigation on this tomorrow, with a test app. I have the driver under several graph layers in my application I am working on so it is kinda hard to tell what is going on.

3
Feature Request / IComComponent new member
« on: March 22, 2018, 03:23:51 PM »
I would like to convert all my code over to using IComComponent instead of the concrete driver classes. This is just for future flexibility. My problem is that, I then do not have access to the IP Address which I would like to have for error messages, and logging.

Would you be willing to added a new member to IComComponent somthing like string AddressOrPort { get; } which would either be populated with a IP address or a serial port name.

If not is there any other way I can access it?

4
Support Questions / OmronEthernetFINSCom Thread Safe?
« on: March 21, 2018, 01:38:25 PM »
Is the OmronEthernetFINSCom driver thread safe? Can I make calls to it from multiple threads? Or will I need to create a new instance for each thread?

5
Open Discussion / Future .NET Standard support (.Net Core)?
« on: March 15, 2017, 08:19:42 AM »
Archie,

Do you plan to or are you open to moving AHMI to targeting .Net Standard? This would allow us to run AHMI on .Net Core on Linux x86 and ARM (When v2.0 is released). The only caveat being that the AHMI UI components could not be included since .Net Core does not currently have it's own UI yet, but we could use all the drivers and subscription components. To me the drivers and subscription stuff is the only reason I use AHMI I prefer to design my own UI components.

6
Support Questions / Windows CE 7
« on: March 08, 2017, 10:41:57 AM »
Can Advanced HMI be built to run on Windows CE 7? Or are there dependency that aren't available in CE?

7
Open Discussion / C# Data Subscriber in a non UI class
« on: September 29, 2016, 10:46:55 AM »
Code: [Select]

public partial class Main : Form
    {
       
        public Main()
        {
            InitializeComponent();


            Program.Logic.Initialize(omronEthernetFINSCom1);
            Program.Logic.DataSubFixtureID.DataChanged += DataSubFixtureID_DataChanged;
            Program.Logic.SequenceDone += Logic_SequenceDone;
        }

        private void Logic_SequenceDone(object sender, Vitrek_Library.MainSequenceDoneEventArgs e)
        {
            throw new NotImplementedException();
        }

        private void DataSubFixtureID_DataChanged(object sender,
            MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs e)
        {

            int fixtureId = Convert.ToInt32(e.Values[0]);
            lblPartNumber.Text = $@"Part Number: {fixtureId}";
        }
    }

public class Logic{
        public DataSubscriber DataSubFixtureID;

        public void Initialize(IComComponent comComponent)
        {
            data = new DataInterface();
            data.Load();

            SeqRight = new Sequences();
            SeqRight.SequenceDone += SeqRight_SequenceDone;
            SeqRight.Initialize(new System.IO.Ports.SerialPort());
            SeqLeft = new Sequences();
            SeqLeft.SequenceDone += SeqLeft_SequenceDone;
            SeqLeft.Initialize(new System.IO.Ports.SerialPort());


            DataSubFixtureID = new DataSubscriber
            {
                PLCAddressValue = new PLCAddressItem("D10"),
                ComComponent = comComponent
            };

        }
}

I get no errors but the DataChanged Event is never fired.

I have a DigitalPanelMeter using the same comComponent using the same address and it works just fine.

Pages: [1]