+6
Under review

Qcode function block with multiple outputs

David Dufour 8 years ago in IQANdesign updated by Jean-Marc Zanni 6 years ago 5

Hi,

There is any plan to have a programming block to allow writing multiple external value. For example, update value to multiple parameters with the same Qcode. Actually, we have to write 1 block for 1 output.

It could be very interesting to be able to link external variable to be updated with this function block.

Thanks,

David

Planned

Great idea, there are plans on introducing this feature in IQANdesign 6.

Curious about the implementation of such block.  As I understand the software A channel we have on a page is basically a variable, not a piece of Code.  The embedded Code (Qcode or Object list) is what will change the value of of that variable and nothing else.  To me this is the essence of good coding.

There is nothing more difficult to troubleshoot than a code were any variable can be modified by any number of routines.  You never know where the problem is coming from.  So I am not in favor of changing external values within a channel.

In the current version up to 5.03 for me, The only option to have multiple values within a channel is the array.  I just wished there was more functionality for the array such as copy, inputs to function blocks and the like to work with it but this is already part of another request.

If the Idea is to implement the notion of data structure where you can mismatch type and assign names to subelements to a channel like having a digital to validate an analog result grouped as one for example then I can agree this would be very helpful. It also would be good as we could allow us to clean-up code appearance if we could group data as a single outputof a function block to be sent as a single Input to another module.

Long time ago, when z8088 where the top of the line, I used to work with a graphical software that used that concept.  We called them pipes.  We would attach a data to a pipe then connect upper level module with the pipe and within other submodule we could access any items of the pipe.  And yes the rule inforced by the compiler was that a pipe element could only have one source (only one write or assignment).  

What would be a practical application level use case for this idea in IQAN ?

+1

Nick,

the main purpose of the idea would be to clean-up code thus making it more readable if implemented properly.  For example, we are working in the marine environment.  We have a throttle module with Twin axis.  Each Axis includes an Analog value for the command and a machine State for each axis.  Those element are generated in a specific Calibration and scaling Function block.  This information is used both for Display and for control of the motors.  Total of 8 data point to move up and down the tree structure.  It has become a bit easier now that we can declare variables as global.


To keep the code clean, we like to put the variable for the screen in a separate function block from the block used for control.  the ability to pass the data block as one group would make it cleaner(less lines) on the screen and more efficient in terms of coding only one Variable to create instead of multiple variables.

The other practical use would be for example for managing display of multiple similar items.  We used banks of batteries(up to 16).  Too much information to display on a single screen.  So currently to select info for one of 16 battery we have pages of "Switches", one for for each bit of information displayed, to feed the detail page.  Every time we make an edit we need to make sure we do not have a copy paste error.  If we could concatenate the variable into one structure and assuming the structure is retained at a global level, we should be able to use a single "switch" driven by a state. 


If I understand correctly the initial idea of this post. what was asked was more like a script that when run, would modify some parameters other than the direct output.  This sounds like another thread about initializing variable for different projects and using IqanRun and/or Scripts to properly initialize value was suggested as an answer.  another method in today's environment this can be implemented either via the Qcode or for  parameter using the Reset function.  a single channel can trigger the appropriate code in each variable that need to be modified. We use this today to have a screens that can be adapted to the different configuration of our system and we do not need an external laptop to set-up the system at the customer place and /or we can have the customer do the configuration on is own.  As a matter of personal choice, I prefer that approach because during troubleshooting, for each variable I can directly see the code that will trigger the calculation.


Combining the two ideas:  our set-up allows for different types of motors for example.  We have a Function block in which a single State parameter is used to automatically select all the key elements for the motor being used (Max Speed, Max Torque, MIn and Max Voltage min and max Current, etc) now each of those single element has to be transmitted to each and every module that uses it. and we can handle up to 3 motors..  A lots of wire and input/output making each function block large on the screen making it difficult sometimes to understand the architecture.


So this is really a functionality for the programmer and the person doing the testing/commissioning.  It adds nothing to what the system does today.