LabVIEW APIs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Run arrow hook

Solved!
Go to solution

I want to add some rust (as in the programming language) code to my project. I'm compiling the rust code to a DLL and then calling the DLL from LabVIEW. I also use git for version control. I DON'T want to put the rust code in a separate repository, compile it to the DLL, give it a version number, copy the DLL to the top level application's repository and run it. Instead I want all the code, VIs and rust to live in the same repository, for the location of the compiled DLL to be ignored by git (with a .gitignore file) and to be able to just click run and have everything compile and run. I realize if I haven't pre-compiled the rust code, when I click run, it will take some time to compile the rust portions.


My foremost challenge here is how do I hook in to the run arrow click event and delay LV from running until the rust code is compiled? Is there some piece of code LV calls when the run arrow is pressed where I can inject my own code?

0 Kudos
Message 1 of 3
(621 Views)

@JonathanMATech wrote:

My foremost challenge here is how do I hook in to the run arrow click event and delay LV from running until the rust code is compiled? Is there some piece of code LV calls when the run arrow is pressed where I can inject my own code?


No.

 

Why not simply run code (e.g. a command line) to do the compile\check when you run the VI?

 

This code would in fact do almost the same as the 'on run' event would do.

0 Kudos
Message 2 of 3
(593 Views)
Solution
Accepted by topic author JonathanMATech

Hopefully this is the dumbest question I've asked on the internet.

 

Q. What code runs when I press the run arrow?

A. My program.

 

Yes, I can just add the code to compile (a cmd command like: `cargo build`) at the beginning of my program before the DLL will be loaded. I can put this in a conditional disable structure configured so the command is removed when compiled to an EXE.

 

Go ahead and laugh at me.

Message 3 of 3
(576 Views)