Replies: 1 comment
-
Hello,
I would define the function block on the C++ side as follows: #include <iostream>
typedef int dint;
typedef struct externFBTest_type {
dint inputvar1;
dint inputvar2;
dint outputvar;
}
extern "C" void exterFBTest(externFBTest_type* self)
{
printf("In C++ : inputvar1 : %d, inputvar2 : %d \n", self->inputvar1, self->inputvar2);
self->outputvar = (inputvar1 * inputvar2);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am trying to call functional block (which is declared as external) (exterFBTest.ST) from ST program(inProgram.ST), and external function block implemented in c++.
but when trying to run the executable, I am getting segmentation fault.
inProgram.ST
exterFBTest.ST
exterFBTest.cpp
main.cpp
build.sh
Output
Is rusty supports external function block??
if yes, then how we can implement such external function block functionality in rusty? (as rusty supports external functions implementation, shown in below url).
https://github.com/PLC-lang/rusty/blob/master/examples/ExternalFunctions.st
Thank You
Beta Was this translation helpful? Give feedback.
All reactions