LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

parallel loops in labview

Hi All,
 
I have a VB dll for executing a function. i am calling this dll function through .NET ActiveX controls in LabView8.0. its working fine. this function will take time to execute. here my task is, i need to display the status that how much the function is executed in a status bar.
 
for this, i have an estimated time. so i kept two parallel loops. one loop wil execute the function. another loop (while loop) will increment the value of status bar. but here, if the execution control goes to dll function, my status bar loop is not getting update. after completing the dll execution only, my status bar loop is executing. is there any ways to over come this?
 
Thanks,
Bannu. 
0 Kudos
Message 1 of 5
(4,938 Views)
Bannu,

i am not too sure about how you call the function. You are talking about three different methods here:
- .NET
- ActiveX
- DLL call
All of these work differently, but do the same for you: to include functions written in other languages in your LV application.
I asume that you are using the DLL call, named "call library function node (clfn)". The settings regarding the executionthread is "run in ui thread". This will do the following:
The UI Thread handles the screenupdate. If you are executing the DLL function in this thread and it takes some time for the execution, the update of your screen will be delayed until the function finishes.

If you are running into this issue, you propably can solve it by setting the executionthread to "reentrant". BUT you can mess things up very easily (without noticing) IF the DLL is NOT "threadsafe".

hope this helps,
Norbert B.
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 5
(4,925 Views)

Hi Norbert ,

Thanks for the reply. i am using ActiveX Vis for my dll calling instead of call library function node why because my dll is a VB ActiveX dll. calling and execution of dll function is working fine.

According to your answer, is my screen wont update utill the dll function execution finishes? is there no way to do this?

Thank,

Bannu.

 

0 Kudos
Message 3 of 5
(4,910 Views)
Bannu,

it mainly depends on the way the VB activeX-DLL is working if the panel is updated or not. I know that some ActiveX-Servers work "exclusivly" leaving the main application without screenupdates. Furthermore, sometimes there are issues if the functions is finished, the fokus is not properly reset to the calling application leaving the window inactive and not updated until the user clicks on it again.....

Maybe you are running into such a "feature". Sadly, there is nothing you can do if you cannot check/change the DLL. If you are running into the fokus-issuem you can use windows sdk functions to set the fokus after the DLL is finished....

hope this helps,
Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 5
(4,871 Views)

Thank you Norbert ..

 

0 Kudos
Message 5 of 5
(4,841 Views)