LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Ring Control: GetCtrlVal , Invalid argument type: found 'pointer to int', expected 'pointer to unsigned char'

Solved!
Go to solution
Highlighted

Version: CVI2019

Hi everyone,

 

I am new to this Labwindows CVI. I have encounter this error below when in ring ctrl GetCtrlVal.

FATAL RUN-TIME ERROR: Invalid argument type: found 'pointer to unsigned char', expected 'pointer to int'.

 

RingCtrl UI

 

sitirasip_0-1602826584771.png

 

GetCtrlVal code

 

sitirasip_1-1602826911384.png

 

Description

The error is saying that it is expecting unsigned char, but then, my value type is actually in int?

In GetCtrlVal description provided by labwindows, it does not specify if GetCtrlVal for ring control have any data type that they need to follow(?)

sitirasip_3-1602828467045.png

Current solution

1. Cast the value to char

sitirasip_4-1602828539312.png

 

Question:

Can you guys explain to me , of why is this happening ?

 

Similar error,but different type.

Other than that, I had also encounter, a fatal runtime error, still a RingCtrl and GetCtrlVal.

This time, my value is in unsigned char. And the error prompt is , they are expecting an int not unsigned char. 

sitirasip_5-1602828810408.png

 

Current solution:

Casting value from unsigned to int. 

 

I'm solving the error but without understanding why is this happening 😞

 

Question:

Can you guys help explaining this to me ? 😥

 

Thank you!

0 Kudos
Message 1 of 3
(151 Views)
Solution
Accepted by sitirasip

Hi,

 

if you are in the 'Edit Ring' popup of the UI editor, click on the button 'Label/Value Pairs...', this will open another popup panel, where the first entry is a ring control 'Data Type'. Here you can specify the data type, int, double, ... of your control values.

0 Kudos
Message 2 of 3
(142 Views)
Highlighted

Wow.

 

For the first fatal error, it turns out the datatype is actually in unsigned char type.

sitirasip_0-1602834654900.png

 


Thank you Wolfgang!

 

p/s: the first fatal error statement is found 'pointer to int', expected 'pointer to unsigned char'. I mistakenly written as found 'pointer to unsigned char', expected 'pointer to int'

 

0 Kudos
Message 3 of 3
(112 Views)