10-16-2020 01:17 AM
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!
Solved! Go to Solution.
10-16-2020 01:44 AM
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.
10-16-2020 02:49 AM - edited 10-16-2020 02:53 AM
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'