Hi Claes,
My custom class module contains many parameter, including several boolean inputs, as shown. The class editor automatically adds invert selections for each boolean input (a very nice feature).
Simple code is used to read connected input values to a local variable for use in a program. This method has two advantages: 1) connected input values can be seen updating in trace mode from an object editor. 2) Program variable names are consistent, whether externally connected or not. The downside may be more CPU horsepower required per point?
The question is how to check the invert parameter for each input? It is not automatically handled. I find no invert parameter references in the custom_class.wb_load file, the custom_class.h file or the class help .
I have been searching through the source code to see how standard logic gates (AND, OR) are handled. Eventually, wb_gcg.cpp and rt_plc_macro_logic.h were discovered. This C++ code is extremely tight and clever with common subroutines used by many function blocks. Of particular interest, gcg_print_inputs checks for connected inputs and invert selections. I do not fully understand it yet, but can appreciate the eloquence.
Would you provide an example line of code showing a simple way to check the status of a boolean invert
parameter for a custom class?
/Ron