LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call Stack Size

Is there a way to increase the call stack size of LabVIEW or to know
when it has been exceeded?

Thanks.
0 Kudos
Message 1 of 7
(3,259 Views)
> Is there a way to increase the call stack size of LabVIEW or to know
> when it has been exceeded?
>

Is there a reason why you are asking about this? LV doesn't actually
use the stack during execution since it it multitasking in according to
dataflow rules. Of course the threads that execute the LV code do have
stacks, but they VI calls don't change the stack. Of course calls into
DLLs or back into the LV engine use it.

Again, is there a problem that you are running into?

Greg McKaskle
0 Kudos
Message 2 of 7
(3,259 Views)
> Is there a reason why you are asking about this? LV doesn't actually
> use the stack during execution since it it multitasking in according to
> dataflow rules. Of course the threads that execute the LV code do have
> stacks, but they VI calls don't change the stack. Of course calls into
> DLLs or back into the LV engine use it.
>
> Again, is there a problem that you are running into?
>
> Greg McKaskle

I am calling an external DLL and running it in the UI thread. How much
stack space is available when they are on separate threads or on the
UI thread?

The problem is that I am getting seemingly random crashes while
running this VI and after I quit labview after stopping and uninit-ing
my DLL.

Thanks.
0 Kudos
Message 3 of 7
(3,259 Views)
> Is there a reason why you are asking about this? LV doesn't actually
> use the stack during execution since it it multitasking in according to
> dataflow rules. Of course the threads that execute the LV code do have
> stacks, but they VI calls don't change the stack. Of course calls into
> DLLs or back into the LV engine use it.
>
> Again, is there a problem that you are running into?
>
> Greg McKaskle

I am calling an external DLL into the VI but I am making these calls
in the UI thread. What is the stack size of the UI thread and will
this change if I run in a separate thread?

The problem is that I am getting seemingly random crashes while using
a VI that is making calls to this DLL. It also almost always crashes
when I try to close the V
I after stopping it and closing the
connection to the DLL. This DLL works perfectly when called into other
test 3rd party apps.
0 Kudos
Message 4 of 7
(3,259 Views)
I am calling an external DLL into the VI but I am making these calls
in the UI thread. What is the stack size of the UI thread and will
this change if I run in a separate thread?

The problem is that I am getting seemingly random crashes while using
a VI that is making calls to this DLL. It also almost always crashes
when I try to close the VI after stopping it and closing the
connection to the DLL. This DLL works perfectly when called into other
test 3rd party apps.
0 Kudos
Message 5 of 7
(3,259 Views)
sunil-online wrote:

> I am calling an external DLL and running it in the UI thread. How much
> stack space is available when they are on separate threads or on the
> UI thread?
>
> The problem is that I am getting seemingly random crashes while
> running this VI and after I quit labview after stopping and uninit-ing
> my DLL.

Unless you know this DLL is using exceedingly lots of stack (at least
several dozens of MB) for whatever obscure reasons it is very unlikely
that running out of stack space is causing your problem. More likely
either the DLL does something nasty to a data pointer passed in to it or
you made an error in setting up the call to the DLL.

For instace if the DLL expects strings or array pointers to be passed in
they need to
be allocated by the caller (here LabVIEW) and you need to
tell LabVIEW to do that in the diagram code.

Rolf Kalbermatter
Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 7
(3,259 Views)
> I am calling an external DLL into the VI but I am making these calls
> in the UI thread. What is the stack size of the UI thread and will
> this change if I run in a separate thread?
>
> The problem is that I am getting seemingly random crashes while using
> a VI that is making calls to this DLL. It also almost always crashes
> when I try to close the VI after stopping it and closing the
> connection to the DLL. This DLL works perfectly when called into other
> test 3rd party apps.

If you run out of stack space, it should be pretty obvious, and won't
just be a problem when closing. If you see a crash like this, it
usually means that the memory was corrupted by writing past the end of
an array or string passed into the DLL. You can
also cause this by
writing over LV's allocated memory.

Greg McKaskle
0 Kudos
Message 7 of 7
(3,259 Views)