12-01-2024 08:51 AM
Hello, I want to build a personalized library in Labview where the user can use our Blocks directly, like we did on Matlab using s_function where we have the function of initialization, output (execution) and the function terminate, so is there any one can help?
actually i'd try to use c++ code then generate DLL then import it to Labviw but i think it should be a specific structure or template that structured the event of execution some function executed once and other in a loop and other in the end.
12-01-2024 11:54 AM
In LabVIEW, the wire determines execution order and once you create your subVIs ("blocks" is not really the right word) it is up to the programmer to use them correctly. If you want to include example code, some parts will be before, some inside, and some after a toplevel while loop.
Make sure to use typical connector panes and assigned connections (e.g. error in/out at the bottom, etc.) Just look at any established toolkit for guidance.
12-02-2024 02:57 AM - edited 12-02-2024 02:58 AM
Implementing your logic in C++ just for the sequential control of your functions is about as smart as trying to build a house by not only building your own bricks first but by manufacturing the sand and other ingredients for those bricks yourself too.
LabVIEW is dataflow driven, which is EXACTLY about sequence control. A node (or subVI) can only start executing when all its inputs are valid (properly generated by previous nodes). And the outputs of a node or subVI are only valid when it has fully finished executing. That lets you chain nodes if you need sequential execution, or not if they may execute in parallel, which they actually will do as far as the number of CPU cores allows on your machine.
12-02-2024 07:21 PM
you can connect to a dll, but not import it.
you can make formula nodes if you want to get something more elaborate in.