Skip to main content
1-Visitor
August 6, 2022
Question

Segmentation Fault in C SDK when getting property data from Thingworx

  • August 6, 2022
  • 1 reply
  • 704 views

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, 1000FALSE);
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

Community Manager
August 11, 2022

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