LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

All functions in DLL gets called

I have written a simple dll with 4 functions:

 

GT_LABVIEW_API void set_reg_event(LVUserEventRef *event_ref);
GT_LABVIEW_API void set_integration_time(int32_t *time_in_ms);
GT_LABVIEW_API void set_acq_state(LVBoolean *active);
GT_LABVIEW_API void set_global_threshold(int32_t *threshold);

 

All these functions are called using "Call library function" nodes, but when debugging and from logging it seems that:

 

1. When operating gui blocks (slider and switch)  connected to  set_integration_time and set_acq_state, all the functions gets called!

2. When manipulating the slider connected to set_global_threshold, none of the functions are called is called.

 

What am I doing wrong?

 

--

Dag Magne

 

block-diagram.png

0 Kudos
Message 1 of 10
(3,237 Views)
Can you attach your code? I'm not sure that I understand question.
0 Kudos
Message 2 of 10
(3,217 Views)

What code would you like to see? Source code for DLL or labview file? 

 

The DLL is written by me, and calls underlying dlls. The issue is that I set breakpoints in Visual Studio C++  in all the mentioned functions, and attach the debugger to labVIEW. When I start the Labview code and e.g. moved the slider connected to set_integration_time, it seems that all the other functions also get called (stops at breakpoints), except when I move the slider connected to the set_global _threshold, none of the breakpoints in the debugger is reached. I also confirm this behaviour through logging to a text file. Labview also gets callbacks from the DLL, and these callbacks also seems to trigger calls to all the functions in the dll...

0 Kudos
Message 3 of 10
(3,206 Views)

Hi Dag,

 

my guess after looking into the glass ball:

1. You have an event handling your "slider and switch". The evtn gets executed and so the loop iterates and all 3 CLFN nodes in the bottom of the loop are executed too. Should be visible using highlight debugging…

 

2. There is no event handling this specific slider, and so the loop does not iterate nor does your VI call any CLFN…

 

But again: attach your VI!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 10
(3,203 Views)

Attached you'll find my labview file. 

0 Kudos
Message 5 of 10
(3,198 Views)

Hi Dag,

 

unfortunately I'm stuck on LV2014 right now, so I cannot open your VI.

 

Either save it for previous version and attach again - or check those points I mentioned before on your own!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(3,188 Views)

Dag,

 

your code "not execute" just because event-structure waits for events. You have "value change" events. So, when you manipulate with Integration time and Active, loop execute and you get dll calling. But Global threshold not execute event, so loop still waiting.

0 Kudos
Message 7 of 10
(3,170 Views)

Attached is a labview v 13 version of the VI code.

0 Kudos
Message 8 of 10
(3,145 Views)

I am not sure that i understand, but I have an event block within an While-loop block. Do you mean that I have to move the sliders outside of this block, and/or into a separate while block?

0 Kudos
Message 9 of 10
(3,143 Views)

Hi Dag,

 

you need to THINK DATAFLOW!

 

You call 3 functions of your DLL in the WHILE loop (at the bottom). Whenever the loop iterates those 3 functions will get called - it's dictated by DATAFLOW!

Your loop will iterate when the event structure recognizes an event and executes the corresponding event case…

 

When you want to call each function at certain conditions then you need to program according to those conditions!

 

Again: THINK DATAFLOW!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 10
(3,138 Views)