Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: ATU on February 18, 2020, 08:12:12 AM

Title: Ethernet and Interrupts
Post by: ATU 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?
Title: Re: Ethernet and Interrupts
Post by: BobO 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?
Title: Re: Ethernet and Interrupts
Post by: ATU 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?
Title: Re: Ethernet and Interrupts
Post by: franji1 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?
Title: Re: Ethernet and Interrupts
Post by: ATU on February 18, 2020, 11:56:33 AM
Yes, Every 200us, the routine time varies but max at 160us.
Title: Re: Ethernet and Interrupts
Post by: BobO 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?
Title: Re: Ethernet and Interrupts
Post by: ATU on February 18, 2020, 01:05:45 PM
Yes, sometimes less, max at 160us
Runs fine until you start pokin' the screen.
Title: Re: Ethernet and Interrupts
Post by: BobO 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.
Title: Re: Ethernet and Interrupts
Post by: ATU 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. 
Title: Re: Ethernet and Interrupts
Post by: BobO 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.
Title: Re: Ethernet and Interrupts
Post by: ATU 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?
Title: Re: Ethernet and Interrupts
Post by: BobO 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.
Title: Re: Ethernet and Interrupts
Post by: ADC Product Engineer 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.
Title: Re: Ethernet and Interrupts
Post by: ATU on February 19, 2020, 10:19:03 AM
Going to give the serial link a try.