Skip to main content
Aug 6, 2022 4:22 PM UTC
Question

Segmentation Fault in C SDK when getting property data from Thingworx

Hello community,

 

I define "data0" as number of remote property in Thingworx. In C SDK, I try to get the value in "data0" using tempPrimitive->val.number. However, there is segmentation fault in the command of "tempPrimitive->val.number"

 

twPrimitive *tempPrimitive = 0;
twApi_ReadProperty(TW_THING, thingName, "data0", &tempPrimitive, 1000, FALSE);
printf("%lf",tempPrimitive->val.number);
 
May I know how to solve the segementation fault issue?
 
Is it related to binary file and library mismatched? If yes, may I know how can I solve mismatched issue?
Thank you.
 

1 reply

Aug 11, 2022 5:50 PM UTC

Hi @SS_10329829.

 

What version of the c-SDK are you running?  Can you send the full code so we have a better idea around the library you're using?

 

Regards.

 

--Sharon