cuentaSergio
Hello!
I’ve updated from version 3 to 4.1.4, and I find it excellent. It’s much more user-friendly and intuitive than the previous one.
As a first basic Ladder program, I created a simple latching circuit. Once I assigned the physical output pins for the Arduino board, I was able to upload it successfully and easily.
The problem arose when I tried to create a C/C++ Function Block to load a short piece of code to link the Ladder variables with the ones I need to use in the C/C++ code. In version 3, this was done using the "External" class and defining the same variable as "External" in both the Ladder program and the C/C++ block. That way, I could use a Ladder output within the C/C++ code.
Now, in the C/C++ block, I don’t see the option to define a variable as "External." On the other hand, when I try to place an "External" class, it doesn't allow me to select it, and if I filter for "External," it won't let me assign variables of that type.
 
Am I missing something? Where am I going wrong?
 
Captura.jpg
Reply 0 0
thiagoralves
You should use C/C++ function blocks the exact same way you use any other Function Block. Write the code for your block, adding input and output variables. Then, if using ladder, drag the block from the library to your ladder diagram and wire it up
Reply 0 0
Reply