News:

  • August 22, 2026, 11:17:21 PM

Login with username, password and session length

Author Topic: Ethernet and Interrupts  (Read 16817 times)

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Ethernet and Interrupts
« on: February 18, 2020, 08:12:12 AM »
I have a C-More Micro linked to a BRX using the Modbus TCP Server.  Could activity initiated on the Micro affect behavior of the interrupt routine?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6172
  • Yes Pinky, Do-more will control the world!
Re: Ethernet and Interrupts
« Reply #1 on: February 18, 2020, 09:10:33 AM »
I have a C-More Micro linked to a BRX using the Modbus TCP Server.  Could activity initiated on the Micro affect behavior of the interrupt routine?

If my rememberer is working correctly, the logic interrupts are a higher priority than comm interrupts. Are you seeing changes?
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Ethernet and Interrupts
« Reply #2 on: February 18, 2020, 10:45:48 AM »
I have one hardware interrupt and one timed interrupt at 200us.  The timed interrupt routine runs about 160us.  When you push a button on the screen, I believe I am missing some of the timed interrupts. I wonder if the micro could be setup as a modbus server and initiate all coms on the PLC side?

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3843
    • Host Engineering
Re: Ethernet and Interrupts
« Reply #3 on: February 18, 2020, 11:10:17 AM »
The timed interrupt routine runs about 160us.
Do you mean execution/turn around time of the servicing of the timed interrupt is 160us?  Is it recurrent timed interrupt?

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Ethernet and Interrupts
« Reply #4 on: February 18, 2020, 11:56:33 AM »
Yes, Every 200us, the routine time varies but max at 160us.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6172
  • Yes Pinky, Do-more will control the world!
Re: Ethernet and Interrupts
« Reply #5 on: February 18, 2020, 12:49:45 PM »
Yes, Every 200us, the routine time varies but max at 160us.

So 160us is the ISR duration, with a 200us interval?
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Ethernet and Interrupts
« Reply #6 on: February 18, 2020, 01:05:45 PM »
Yes, sometimes less, max at 160us
Runs fine until you start pokin' the screen.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6172
  • Yes Pinky, Do-more will control the world!
Re: Ethernet and Interrupts
« Reply #7 on: February 18, 2020, 01:12:19 PM »
Yes, sometimes less, max at 160us
Runs fine until you start pokin' the screen.

Depending on the average of that ISR, you are (well?) over 50% CPU utilization. That's getting into the danger zone. Consider reducing timer frequency, or reduce the ISR time. Comms do shut interrupts off for short periods, that is probably delaying the servicing enough to push that 160 past 200.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Ethernet and Interrupts
« Reply #8 on: February 18, 2020, 01:28:17 PM »
Nothing like living on the edge.   However, it never misses a lick if the hands are off the HMI. They will have to pause the test to make adjustments. 

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6172
  • Yes Pinky, Do-more will control the world!
Re: Ethernet and Interrupts
« Reply #9 on: February 18, 2020, 05:09:02 PM »
Nothing like living on the edge.   However, it never misses a lick if the hands are off the HMI. They will have to pause the test to make adjustments.

You might move the HMI to the serial port. That might eliminate the issue.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Ethernet and Interrupts
« Reply #10 on: February 18, 2020, 05:51:05 PM »
I was considering  that. Does the Serial Port use a system interrupt or is it part of the background?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6172
  • Yes Pinky, Do-more will control the world!
Re: Ethernet and Interrupts
« Reply #11 on: February 18, 2020, 06:10:25 PM »
I was considering  that. Does the Serial Port use a system interrupt or is it part of the background?

It uses an interrupt, but it may be a lower impact than Ethernet.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ADC Product Engineer

  • Hero Member
  • *****
  • Posts: 270
Re: Ethernet and Interrupts
« Reply #12 on: February 19, 2020, 07:30:18 AM »
I have one hardware interrupt and one timed interrupt at 200us.  The timed interrupt routine runs about 160us.  When you push a button on the screen, I believe I am missing some of the timed interrupts. I wonder if the micro could be setup as a modbus server and initiate all coms on the PLC side?

You really don't want a slave HMI, trust me.  It is super messy.  Pretty much guaranteed to never work like you want it to.

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Ethernet and Interrupts
« Reply #13 on: February 19, 2020, 10:19:03 AM »
Going to give the serial link a try.