MATRIXx

cancel
Showing results for 
Search instead for 
Did you mean: 

Copy input labels to output labels

In SystemBuild, when I use a gain block or a switch block, all my output variable labels disappear.  Is there an easy way to copy the input variable label list to the output variable list?  In some cases, I have over 1500 outputs and retyping each one is not convenient.  (This request assumes a 1 to 1 relationship.)
0 Kudos
Message 1 of 4
(9,632 Views)

Hi Bob,

Between blocks, labels do not automatically propagate. Only through levels of superblocks do labels go into and out of a superblock reference.

The easiest way to propagate labels between blocks is to use SBA commands. Here's an example: Assume block ID=2 has its inputs connected to other block(s). Assuming that blockID=2 has the same number of outputs as inputs, here's the commands to copy the inputs to the outputs:

[a=inputsignal]=queryblock(2);
modifyblock 2,{outputlabel=a};

If there is a mismatch between the number of inputs and outputs, the above commands will work, with the data being used as best as possible.

I am concerned about your other comment, "..when I used a gain block or switch block, all my output variable labels disappear."  This should not happen at all, can you explain in more detail what you are doing or supply a small test case, because this does not sound correct.

Regards,

Bob Pizzi

 

0 Kudos
Message 2 of 4
(9,624 Views)

Thanks.  That's what I needed.  How would it vary if I wanted an offset?

Is there a manual available with all the SBA commands that relate to SystemBuild?

0 Kudos
Message 3 of 4
(9,621 Views)

Hi Bob,

Well, all of the SBA commands are documented in the online help. You can browse the topics to find 'SBA' or from xmath command line, type 'help sba' and that will get to jump started into the help for SBA commands.

Once you extract out the input signals from the block, the result is just a string matrix. You can manipulate it as you need to before using it to modify the block's output labels. The one trick is that you have to set all output labels at once, that's the easiest. So, once you set that string matrix to be the data you want, it is a simple thing to update all of them at once. There is syntax to modify (or get) one signal at a time, append the pin number (1-based) to the end of the keyword. Here's an example to get just the output label of the second pin and modify the 3rd pin of another block.

[a=outputlabel2] =queryblock(1)
modifyblock 2,{outputlabel3 = a}

 

bob

 

0 Kudos
Message 4 of 4
(9,585 Views)