Unity function with block dynamic array input

V0N_hydro

Member
Join Date
Sep 2010
Location
lower mainland
Posts
560
Hi,

I want to create a block that takes a dynamic number of inputs like the AND, OR or MUX blocks in Unity Pro for Schneider Quantum PLC. You can drag the bottom edge of those blocks and get more input pins. I can't figure out how to make my own block do that.

I have unity pro xl.

Maybe I don't need to do this at all;

I want to select between X different input signals based on X different boolean variables. The MUX block that comes with Unity takes an integer as the input.

I don't have an integer, I have a X booleans which are set true by an action in the step of the Sequential Function Chart SFC which ensures that only one of the booleans can be true at any given time.

so I want to make a block that takes X booleans as inputs and outputs the index of the input that is true.

This is simple when X is a constant, but I would like to make only one block for all values of X up to 50 without making 50 blocks.


Any ideas on how to achieve this, or a better approach altogether?

thanks
 
Why can't the SFC set the value of an integer tag and then use that value to drive the standard Mux block?

I don't think it is possible to make a dfb with a variable number of inputs (If I'm wrong someone please correct me and share the secret)
 
Why dont you use the sfc dfb blocks that tells you what number of the chart is active at the moment. (maybe i'm missing the whole point here)
 
Why dont you use the sfc dfb blocks that tells you what number of the chart is active at the moment. (maybe i'm missing the whole point here)

I am using the "StepName".x BOOL value "1: Step active" or "0: Step inactive" variables to determine what step is active and feeding that into the DFB that greg suggests and then that to MUX.

Thanks for your thoughts
 

Similar Topics

I'm relatively new to FB after programming in ladder for year. In Unity, how can I have an output of a block set multiple bits? For instance, the...
Replies
8
Views
3,356
Does anybody know how to remove the password of a protected function block and/or section code?
Replies
0
Views
3,164
Is there a way to snap function blocks to a grid in unity? This is for pure aesthetics reasons I know. But it can be frustrating to navigate...
Replies
3
Views
1,571
I'm a Siemens guys switching to Schneider/modicon stuff. There are two pieces of equipment they used to run independently but they've...
Replies
8
Views
4,637
Hi I am using the DATA_EXCH block to read data over Serial 485 Modbus. I need to poll inputs 1X00000 registers. The RECP of the DATA_EXCH block...
Replies
0
Views
1,103
Back
Top Bottom