News:

  • September 30, 2026, 07:07:57 PM

Login with username, password and session length

Author Topic: Do-More Instruction Execution time  (Read 13229 times)

JeffS

  • Hero Member
  • *****
  • Posts: 113
Do-More Instruction Execution time
« on: August 23, 2019, 02:55:54 PM »
I know at the back the DL06 manual there is an appendix with execution times for the various instructions.   Does something like that exists for the Do-more?  I am building out a program and don't want to end up choosing commands that slow my scan time when I could use a different command and save processing time.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Do-More Instruction Execution time
« Reply #1 on: August 23, 2019, 03:03:56 PM »
There isn't, sorry. Processor caching greatly affects the speed and makes it impossible to give an absolute number.

What type of programming are you doing, and what concerns you most?
"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

JeffS

  • Hero Member
  • *****
  • Posts: 113
Re: Do-More Instruction Execution time
« Reply #2 on: August 23, 2019, 03:50:00 PM »
In my program I end up shifting memory around a lot and doing that I have been using FOR loops to quickly index through the memory locations that need moved/copied.  I could accomplish this same task with a number of rungs equal to the FOR loop cycles.  The FOR is quick for me to write, but seems it slower to execute, but how much slower?

Another bit I was wondering about is wether it matters if I use MEMCOPY, COPY, MOVER, MOVE.  So far I have been using COPY as it looks clean and I can move strings or values and single elements or ranges and takes into account the data type.   Most of the time I copy from similar data blocks so I could use several MEMOPY commands instead.  Also so long as I am not moving strings, then I can use MOVER or MOVE depending on if it is one element or a range.  Is one method faster than another?

I also wonder about is using nested IF statements in a MATH blocks vs using several rungs to check my "if" logic.  One is nice and compact, the other is more spread out and uses more program memory, but is one faster than the other to execute?

Some of these concerns arise from the amount of ethernet communications that I am driving from the BRX and it appears that as the scan time increases the longer it takes to execute some ethernet communications, so I want to keep my scan time as short as possible.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Do-More Instruction Execution time
« Reply #3 on: August 23, 2019, 04:12:37 PM »
Loops are considerably slower than other methods, but they offer the advantage of yielding when used in program or task blocks other than $Main. This allows you to break up long operations across multiple scans.

COPY is just a pretty front end for a number of other instructions, so that you don't have to understand the others.

The best thing I can suggest is to use TICKus() in the MATH box to profile some of what you want to know...MATH D0 = TICKus() before an instruction and MATH D1 = TICKus() - D0 after.

Ethernet comms bump the scan pretty heavily, but the bumps are generally pretty sparse. So max shows 1 to 1.5ms higher than min, but the average is usually pretty close to min. Comms are handled at one specific part of the scan, so scan time increase will definitely slow down comm throughput.
"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

JeffS

  • Hero Member
  • *****
  • Posts: 113
Re: Do-More Instruction Execution time
« Reply #4 on: August 23, 2019, 05:33:53 PM »
OK, thanks for the advice.

One other question, does using user memory blocks slow execution vs built in memory blocks?  Recently found out that accessing these blocks from a c-more is slower than the built in blocks, so just wanted to know if they slow the BRX execution down as well.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Do-More Instruction Execution time
« Reply #5 on: August 23, 2019, 05:43:18 PM »
One other question, does using user memory blocks slow execution vs built in memory blocks?  Recently found out that accessing these blocks from a c-more is slower than the built in blocks, so just wanted to know if they slow the BRX execution down as well.

No. There is no difference. There isn't any difference in comm either. The symbolic driver was a convenience for C-more developers to access stuff outside the built-in memory, not due to a limitation in the controller. Having the controller parse every requested element name is always going to be slower than a simple indexed access.
"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

JeffS

  • Hero Member
  • *****
  • Posts: 113
Re: Do-More Instruction Execution time
« Reply #6 on: August 23, 2019, 06:25:40 PM »
OK, good to know.

So I have my program running with a scan time of ~50ms and I am talking to 16 other PLCs every second with one read and one write action.  I noticed that I started to get some timeout errors from my TS with the timeouts at 100ms after I implemented the comms with the other PLCs.  I will be adding more PLCs, to 26 total, that I need to poll and I would like the frequency to be as high as possible.  Is there a limit to the number of ecom actions that can be executed per scan?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Do-More Instruction Execution time
« Reply #7 on: August 23, 2019, 06:30:00 PM »
OK, good to know.

So I have my program running with a scan time of ~50ms and I am talking to 16 other PLCs every second with one read and one write action.  I noticed that I started to get some timeout errors from my TS with the timeouts at 100ms after I implemented the comms with the other PLCs.  I will be adding more PLCs, to 26 total, that I need to poll and I would like the frequency to be as high as possible.  Is there a limit to the number of ecom actions that can be executed per scan?

50ms? Wow. Surely you can do some stuff to help that.

ECOM module? Yes, they are limited to 4 or 1, depending on the transaction type.
"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

JeffS

  • Hero Member
  • *****
  • Posts: 113
Re: Do-More Instruction Execution time
« Reply #8 on: August 23, 2019, 07:09:06 PM »
Ecom actions are using the built in domore ethernet port.  Target PLCs are a mix of BRXs and DL06s.  Would utilizing the Ethernet POM for some of the communications help?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Do-More Instruction Execution time
« Reply #9 on: August 23, 2019, 11:31:35 PM »
Ethernet POM is slave only.

I'd look at bringing your scan time down. 50ms is pretty high for a Do-more CPU. Should be able to find ways to do that. We're happy to review your program and make suggestions.
"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