Part 4: Communication between two asynchronous packages

../../_images/Tut_PT_Part4.png

Objective

Communication of two asynchronous packages which were created from the same “parent” package.

Test creation

  1. Switch to “receiver1” in test case editor

  2. Create the variable “receiveLine” with the type “inbox”, maintaining the standard settings, and mark it as input parameter

  3. Insert the test step “read from inbox” under Test steps ‣ Data operations within the loop, selecting the inbox “receiveLine” and and specifying as expectation value that the measuring value is equal to “loopCounter”

  4. Switch to “main” in test case editor

  5. Hide the loop

  6. Create the variable “relais” with the type “relay”, maintaining the standard settings

  7. Link the outbox “sendLine” with “relais” via the package parameterization dialog of “sender”

  8. Link the inbox “receiveLine” with “relais” via the package parameterization dialog of “receiver1”

  9. Save all packages and execute the main package

Result

The loop counter is now propagated not between the calling and the called package but between two packages that are in no relation with each other. The comparison is made according to the same principle as before by “main”.

Remark

A relay functions as a mediator of inboxes and outboxes between two called-up packages. That mediation takes place after the relay was linked with an inbox and an outbox. Data cannot be communicated to several receivers.