Discrete blocks

Discrete blocks

State block

ADL treats the act of sending request and receiving confirmation messages from the exchange server as discrete events, or events which occur at a single moment in time (see: Continuous Vs. Discrete Event Messages for more information). In addition to these events, the user can define custom discrete events by double-clicking on the State block and using the Formula Builder do define True/False statements for the Transaction Formulas field. When these True/False statements turn TRUE, ADL will consider it as an occurrence of a discrete event. By default, you can define up to two discrete events, but an option exists to allow the user to add extra slots and define more than two events using the Formula Editor.

After the statements are defined, the State block must be triggered by a discrete event message. The block does not act upon the trigger, but merely becomes "loaded," ready to "fire" a discrete event message from one of its outputs when a user-made True/False statement turns TRUE.

When a user-made True/False statement turns TRUE, the State block generates and outputs a discrete event message in the following manner:

  • Directs the message to the #1 output if the statement tied to it evaluates to TRUE
  • Directs the message to the #2 output if the statement tied to it evaluates to TRUE
  • Outputs a message from the top-most port when multiple True/False statements turn TRUE at once

Example Send the incoming discrete event message through output port 1 if the fill quantity in the message is less than half of the order quantity

After outputting a discrete event message, the State block must be reloaded by another incoming discrete event message.

Note The State block will not "queue" up multiple incoming discrete event messages - even if multiple message enter the State block, the block can only output a single discrete event message.

Block properties

To customize the block, update the Block Properties.

Property Description
Name Name to display beneath the block on the ADL canvas

Equations used to calculate the value of the block's output ports

The edit link opens the Formula Editor.