LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

An Error "Uninitialized pointer argument to library function" when I use viIn32() Function

I want to use viIn32(*,*,*,val) to get the data(setted to be 0x4) from PXI device. But when I debugged the code, There is An

FATAL RUN-TIME ERROR: "Main.c", line 376, col 40, thread id 0x000000B0: Uninitialized pointer argument to library function.

I right clicked on the variable and select "View Variable Value". I found the value of val is "0x00000100(0) (no size info)".

I want to know what this means and how to sovle this problem. 

0 Kudos
Message 1 of 3
(3,385 Views)

@Treefull wrote:

I want to use viIn32(*,*,*,val) to get the data(setted to be 0x4) from PXI device. But when I debugged the code, There is An

FATAL RUN-TIME ERROR: "Main.c", line 376, col 40, thread id 0x000000B0: Uninitialized pointer argument to library function.


Hi,

 

the function you are using should look something like


status = viIn32 (instrument_handle, VI_A16_SPACE, offset, &value);

 

value is a pointer of type ViUInt32 and needs to be initialized before you use it in this function call: how did you declare value in your code, and (how) did you initialize it? The error message suggests that you did not initialize it...

0 Kudos
Message 2 of 3
(3,384 Views)

Thank you for your reply!

I have solved the problem.

In the old code, I defined the val as ViPUInt32 derectly.

Now, I defined the val as ViUInt32, and used &val in the viIn32() function.


Wolfgang 已写:

@Treefull wrote:

I want to use viIn32(*,*,*,val) to get the data(setted to be 0x4) from PXI device. But when I debugged the code, There is An

FATAL RUN-TIME ERROR: "Main.c", line 376, col 40, thread id 0x000000B0: Uninitialized pointer argument to library function.


Hi,

 

the function you are using should look something like


status = viIn32 (instrument_handle, VI_A16_SPACE, offset, &value);

 

value is a pointer of type ViUInt32 and needs to be initialized before you use it in this function call: how did you declare value in your code, and (how) did you initialize it? The error message suggests that you did not initialize it...


 

0 Kudos
Message 3 of 3
(3,381 Views)