How to read a downstream process's demand from a Python add-on? (VC 5.1)

What the model looks like:

                 upstream feed
                       │
                       ▼
        ┌──────────────┴──────────────┐
        │   FlowProxy (dynamic conn.) │  ← internal port 0 → layer "Input"
        │   only 2 internal ports     │  ← internal port 1 → layer "Output"
        └──────────────┬──────────────┘
                       │  (Side A – used for BOTH in and out)
        ═══════════════╪═══════════════
        │  MainPath    │  layer 1 (container, has its own TransportNode)
        │  MainPath_2  │  layer 2
        │  MainPath_3  │  layer 3
        │  MainPath_4  │  layer 4
        ═══════════════╪═══════════════
                       │
            servo moves the stack up/down;
            at any moment only ONE layer is aligned
            with Side A (and thus with the FlowProxy)
  1. The 4 layer paths (MainPath, MainPath_2..4) are 4 independent parallel containers, each with its own TransportNode.
  2. A servo lifts/lowers the stack so that exactly one layer faces the port side.
  3. The script’s only job is to move the servo so the layer that is “wanted” aligns, and to connect the port (connectInternally). The script is not supposed to invent its own routing.

We cannot find any way to obtain that downstream demand from Python.

I don’t fully get your concept, but seems to me whether this is possible depends on if you are trying to use multiple transport nodes with single process or not. Generally you can’t have more than one transport node per process if you are using the PM product need and feed system.

On the other hand if you are not using the need and feed system then you could manipulate the transport solutions using scripts to route the products as you wish.

By the “downstream process’s demand” I guess you mean that some downstream process uses the PM need feed matching system to TransportIn products? That requires that for any transport to happen your process / buffer has a product feed that can be matched to the TransportIn’s product need. Usually if you have a buffer, it publishes all its products as product feeds all the time so any of them can be matched and transported out.

In the situation where your buffer has published a product feed and it got matched, a transport solution gets created to it and the source transport node is asked to send the product. If you created and are controlling the matched vcProductFeed object from python script instead of using e.g. TransportOut or Buffer statement, then you could react to the match being finalized and get the product and its destination info. That info would be enough to move your lift servo so that the path is cleared for the particular product to move out.

The setOnTransportTargetRequested callback setter is for handling placement of incoming products, so e.g. custom buffer implementations can tell human resource which shelf to place a particular product. It can’t be used for reacting to products moving out.

You might be able to do something with setOnProductLeaving callback if you model your containers such that a product leaves a transport node before the lift needs to actually move. You could get the product’s info and move the lift there.

This is just my maybe bit incoherent flow of thoughts, not any proven solutions.