LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i create a NULL-Pointer

Hello,
how can i create a NULL-pointer (like in C) to call a DLL-function in Labview 8?

I have this function:
XXXXXX FuncName(int32 handle,
char * aCharName,
void * aVoidName,
int32 aInt32Name,
char * Msg);

and have to call it like this:
rc=InitCasRunF(&handle, NULL, NULL, NULL, msg);

When running the vi i get a popup with this message:

Labview: An exception occured within the external code called by a Call Library Function Node.
This might have corrupted Labview´s memory. Save any work to a new location and restart Labview.
VI "......." was stopped at Call Library Function Node Call Library FuncName 0x13E0 of subVI.
Democall.vi


The attached democall.vi is not the original but its like that.

Thanks for any help how i have to create thi NULL-pointer

Message Edited by NewOne on 01-25-2006 03:42 AM

0 Kudos
Message 1 of 11
(4,799 Views)
Pass null unsigned or signed 32-bit integers by value.

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 11
(4,779 Views)
Thats what i did in my example.
Do you think this works also for a char or void NULL-pointer?
0 Kudos
Message 3 of 11
(4,770 Views)
Sure, any pointer is a 32 bit value (in Win32, of course).
I don't have LV8 so I could not open your vi.
The reason for the crash should be another, in my opinion.

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 11
(4,768 Views)
Ok, i resaved it for 7.1 perhaps you see an problem.
its not executable, just to show how i try to do it.
thx for your help
0 Kudos
Message 5 of 11
(4,763 Views)
You are passing a LV null string for the second parameter. I think that LV does not pass a null pointer, rather a valid pointer to a null string.
Try replacing second parameter with a numeric one like third and fourth.
Other possibility: msg returned is longer than 255 chars.

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 6 of 11
(4,752 Views)
Thanks for your ideas but doesnt work both.
- i replaced the string with numeric
- and tried a longer string for msg
0 Kudos
Message 7 of 11
(4,745 Views)
Only few ideas remained: are you sure about the calling conventions?
Is the function working when called by a C program? Did you write the dll or inherited it or it's a system dll?

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 8 of 11
(4,744 Views)
Another thing to try is to change the calling convention from WinAPI to C.  Some DLLs written in C need to be called with the C calling convention.
- tbob

Inventor of the WORM Global
0 Kudos
Message 9 of 11
(4,734 Views)
Thx for your help. Meanwhile it works. It was a stupid, easy thing i didnt see all the time.
I had to change the first parameter as--> Pass: "Pointer to value" instead of "Value". Thats all.
All NULL-values are passed as Int32-value.

One new problem occurs now: After runnning the function Labview crashes down.
Error-report is attached if someone can read someting in this.

When running the dll-function in a c-program it works
When calling the dll-function it in teststand it also works.

Message Edited by NewOne on 01-26-2006 05:14 AM

0 Kudos
Message 10 of 11
(4,710 Views)