Announcement

Collapse
No announcement yet.

Performance of interface to Productivity 1000 modules.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Performance of interface to Productivity 1000 modules.

    Purpose: To Evaluate the P1AM for industrial application, issue/concern with the performance of Productivity 1000 IO functions.

    Dependencies:
    #include <P1AM.h>

    Code: P1.readDiscrete(1,1);

    We are in the process of evaluating the P1AM and Productivity 1000 interface modules for use in industrial applications. We have a P1AM with several P1AM Arduino Shields and Productivity 1000 modules and are developing test scenarios and associated code for. One of the observation that we have made is that the processing speed (as measured by loop processing time) decreases significantly when interface calls are made.

    From a scenario run there is a sketch of small/modest side with a P1.readDiscrete(1,1); function call. Loop time for this sketch was estimated to be 540 uSec. When this single function is replaced with constant the loop time estimate drops to 11 uSec.

    Are we doing something incorrectly or does the function call take about 520 uSec to complete/execute?

    Regards,
    Steven C.


  • #2
    That sounds correct. Due to the nature of the Base Controller and P1000 Backplane, there is some overhead in communicating with IO modules. More modules in the base will increase this overhead as well.

    For speeding up communications across multiple points look into the "BitmappedDiscrete" and "BlockDataTransfer" examples. They won't decrease your current latency, but save time when you need to query multiple channels. In applications with many points that are sensitive to timing, blockData can be especially helpful.

    Comment


    • #3
      Thank you for your reply,

      We understand that the use of "BitmappedDiscrete" and "BlockDataTransfer" can reduce the number of read and write calls required. But some colleagues are still concerned about IO call execution time. I was asked to follow up on the availability of what I believe are called either; asynchronous or non-blocking function calls for IO?

      To clarify the request, I was provided the following model implementation.


      -- In Globals
      int RequestIndex;


      -- In Setup
      P1.InitRequestSystem();
      RequestIndex = 0;


      -- In Loop

      //--OTHER CODE--

      if ((P1.GetRequestStatus() == READY) && NeedFreshBitStatus_1_1Value)
      {
      P1.RequestDiscrete(1,1); //P1.GetRequestStatus() would now return PROCESSING
      RequestIndex=1;
      }

      //--OTHER CODE--

      if ((P1.GetRequestStatus() == PROCESSING) //P1.GetRequestStatus() returns PROCESSING until transfer is complete.
      {
      //Possibly some code to run specifically while waiting for IO to complete
      }

      //--OTHER CODE--

      if ((P1.GetRequestStatus() == DONE) //System Completed Transfer
      {
      if (RequestIndex == 1)
      {
      BitStatus_1_1 = P1.GetRequestedDiscrete(); //P1.GetRequestStatus() would now return READY
      }
      RequestIndex=0;
      }

      //--OTHER CODE--

      Comment


      • #4
        Currently we do not have any plans to support asynchronous calls in the P1AM .

        If you wanted to try and create it yourself: There are ports of FreeRTOS for the SAMD21. You would want to setthat up and modify the P1AM library or your task/calls so that they have a sempahore or other ROTS object to notify your main task when IO scans have been updated. If you are using any other SPI devices, you would need locks on those as well.

        Comment

        Working...
        X