Author Topic: Possible for ExecTime of 3.0 ms or less?  (Read 1179 times)

Offline FluidPowerTom

  • PLUS+1 Guru
  • *****
  • Posts: 363
  • Karma: +32/-0
Possible for ExecTime of 3.0 ms or less?
« on: November 08, 2022, 06:15:36 PM »
I've got an application that's going to require reading a sensor signal as often as 3.0ms.  I've never had an application that really needed faster than about 10ms scan time.  My plan is to grab a controller, put a minor program onto it with just some input scaling and CAN transmitting functions, and then run it for a while.  I know ExecTime is a rounded integer, so I guess I'll just watch LoopCnt and ETime to calculate the actual execution/scan time.

My question is... has anyone done this and been able to see 3.0ms or less on a MC?  I know the new autonomy controller is supposed to be able to do 1ms, but I've never heard of a MC confirmed running a program at 3.0ms or less.

EDIT:  This question might have been better suited for the software discussion, but it seems like it could also be a hardware topic since we're really talking about the processor.
Controls Engineer
Hydra-Power Systems

Offline Matt_Eng

  • PLUS+1 Developer
  • ***
  • Posts: 21
  • Karma: +10/-0
Re: Possible for ExecTime of 3.0 ms or less?
« Reply #1 on: November 08, 2022, 07:43:14 PM »
I guess I have frequently had 1 or 2 ms execution times on my MCs, but the applications are very light and only contain several function blocks.
The lowest I've gotten an SC down to was 2ms.

Regarding your other point about receiving a message every 3ms.
If you are unable to reduce your loop time, there are a couple strategies you could use to still have a functional application. Here are the two I frequently use.
Route 1: If you only need to receive the latest message and act on the data then you can just set the Protected flag on the CAN component to False. Then it would only present the latest data for the application.
Route 2: If every message is important then you would set up several CAN receivers with the Protected flag set to True. Then you would process multiple messages in one loop. Given a loop time of 10 ms, you would set up 4 CAN receivers to make sure you can catch every message.
-Matt

Offline FluidPowerTom

  • PLUS+1 Guru
  • *****
  • Posts: 363
  • Karma: +32/-0
Re: Possible for ExecTime of 3.0 ms or less?
« Reply #2 on: November 08, 2022, 10:28:14 PM »
That's encouraging that you're able to get 1 or 2ms scan times.  This will be a very light application, and if I focus on efficiency then maybe it will work out.

It's not a CAN message that I need to receive that often.  It's an analog voltage sensor.  So, I figure I should be able to pick up the sensor value every scan.
Controls Engineer
Hydra-Power Systems