REXYGEN Community Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Login

    Vector demultiplexer VTOR+Python processing

    REXYGEN Studio
    2
    2
    35
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      stepan.ozana
      last edited by stepan.ozana

      Hi,
      I'd like to ask why outputs of VTOR1 shows all zeros. Both Python blocks share the same python script.
      It seems like the issue is connected to sources of u0,u1,u2.
      Source project: ex.zip
      8ff11fa1-937b-4c2a-bf6f-5cb181f64647-image.png

      Best regards, Stepan

      J 1 Reply Last reply Reply Quote 0
      • J
        Jan Reitinger @stepan.ozana
        last edited by

        Hello @stepan-ozana,
        The main point from our developer's explanation is that the problem occurs because the Python script assigns outputs from inputs only during the initialization phase (init). However, while the CNR block sets its output directly in init (based on its parameter), the VTOR block likely receives its output settings only after the first run of its main function.

        Generally, blocks should not process inputs from other blocks during init. During init, each block should manage itself: check parameter settings and initialize its own outputs to starting values. Any processing of inputs and outputs involving other blocks should happen in the main runtime phase.

        In this case, CNR correctly sets its output in init according to its parameter, which is acceptable. VTOR must read its inputs to set outputs, so it does this later in the main function, which is also correct.

        Thus, the VTOR output being zero initially can happen because it does not update outputs until the main function runs, unlike CNR which sets fixed output at init. This explains the observed behavior with the VTOR1 showing zeros at first while sharing the same Python script with another block

        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        This is a community forum for REXYGEN users and fans. Detailed information can be found at REXYGEN homepage.

        There is also an outdated REXYGEN community forum.

        Powered by NodeBB.