From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loop doesn't work after creating an executable

Solved!
Go to solution

Hello everyone,

I have an issue with a part of my code in LabVIEW.
My code is simple, the goal is to initialize a generator and command it in order to increase the gain with a condition stop (see attached file).

But unfortunately this code doestn't works after creating an executable.
I think is due to the ".dll" but I don't know what to do with that.

If somebody have any ideas, do not hesitate ! 😉

0 Kudos
Message 1 of 10
(1,582 Views)

Well, the first thing to do would probably be to get the error message.  None of your code is hooked up to anything to handle errors.

 

If you run it normally as a VI, you might see errors due to "Automatic error handling" being turned on, but that goes away in an EXE.  So you need to attach an "error out" control or one of the error handling VIs to each DLL call.

 

Also, in general stacked sequence structures are not recommended.  Consider using a state machine or some other architecture that allows the sequence to be browsed through easier and aborted part-way through if there's an error.

Message 2 of 10
(1,565 Views)

You need to define what "doesn't work" means. Could be anything from "runs, but wrong result", to a computer crash).

 

Are you running the executable on the same computer used to build the exe? (In this case, make sure LabVIEW development system is closed so it does not reserve any shared resource used by the driver).

 

Is the dll location in the system search path? You can also specify the path on the diagram and wire the correct path.

 

Did you add the dlls to the project and specify it as "always include" in the build specification?

Message 3 of 10
(1,538 Views)

While we wait for you to answer altenbach's questions, I'll mention that you shouldn't upload Microsoft Word files as they can be virus-ridden and some people on here won't even look at them. Upload a pdf instead.

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

Message 4 of 10
(1,509 Views)

Thanks Kyle to take time to answer.

I will try with an handle errors for each ".dll" used, but without that I have no error message from LabVIEW.

What do you mean by "Consider using a state machine or some other architecture that allows the sequence to be browsed through easier and aborted part-way through if there's an error." ?
I don't really understand.. is preferable to do my generator initialization in just one sequence part ?


0 Kudos
Message 5 of 10
(1,477 Views)

Thanks altenbach to take time to answer.

 

Here a PDF to explain exactly what I mean by "runs, but wrong result".
I hope it will be clear for you !

VI and EXE has been done on the same computer. Furthermore sub-VI is always in the same folder.

"In this case, make sure LabVIEW development system is closed so it does not reserve any shared resource used by the driver"
 -> You mean during EXE construction or EXE running ?

 

The path of this ".dll" is defined at the end of the word file or its PDF version that I just upload (as suggest by Redhawk 🙂).
And I have already check that each ".dll" come from the same path.

I think I have already done this option ("always include") but I will recheck to verify.

Download All
0 Kudos
Message 6 of 10
(1,470 Views)

*UPDATE*

After creating an error out indicator for each ".dll" I found there is the famous 1124 errorCall Library Function Node in Programme MyProg.vi <APPEND> apint usb.vi ) when I initialize the generator filter and when gain start to increase with the EXE (see Debugging.pdf ).

I have searched subjects related to this error and all speak about the path of file that cause the issue (in my case "Ap_int_usb.dll").
But I don't understand their ideas, even how do to them..


Someone can help ?

(examples of 1124 subjects:

https://forums.ni.com/t5/LabVIEW/Weird-problem-error-1124-quot-vi-not-loadable-quot-please-help/td-p...

or https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019NFfSAM&l=fr-FR )

 

0 Kudos
Message 7 of 10
(1,445 Views)
Solution
Accepted by topic author Sa5m974

Try checking the box to specify the path on diagram (on the configuration screen of the CLFN) and wire in the correct path to the CLFN.

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

Message 8 of 10
(1,434 Views)

*SOLUTION*

 

As you say Redhawk (and altenbach before) LabVIEW need absolutely to connect the path directly to CLFN and not enter it in Configuration window of CLFN... weird.

Thanks for heping !

Download All
0 Kudos
Message 9 of 10
(1,400 Views)

@Sa5m974 wrote:

 

As you say Redhawk (and altenbach before) LabVIEW need absolutely to connect the path directly to CLFN and not enter it in Configuration window of CLFN... weird.


Nothing weird.

 

I did not say "absolutely connect..." because that's not true. All you need to do is ensure that the dll (and whatever else it requires) is in the search path. When you specify the dlls as "always include" in the build specification, it will be copied to the "data" folder next to the executable where it will be found at run time. (See also). Hard-wiring the path is not such a good idea because it might not always be installed on the C: drive on all systems.

 

(Of course you will probably built an installer where again the "data" folder will be placed correctly)

 

(You really need to do something about these sequence structures and sequence locals. Nobody programs like that anymore.)

 

Does the dll really need to run in the UI thread? Maybe you can encapsulate it into a non-reentrant subVI that only has the useful inputs and outputs exposed.

0 Kudos
Message 10 of 10
(1,384 Views)