Skip to main content
16-Pearl
March 27, 2024
Solved

Property values are repeating while using QueryPropertyHistory Service in ThingWorx

  • March 27, 2024
  • 3 replies
  • 31440 views

Hello Everyone

Good Evening,

 

I am facing problem in logging properties there are some values which are repeating after I carry out the experience multiple times.

PFA attached image in which arrows are shown on the readings which are repeating when I consume the AR experience on my Ipad on view app for multiple times.

 

I just want to log the properties which are entered by the user on vuforia view app.

Below is the code I am using to write properties from Vuforia Studio to Thingworx:

I have written 2 services for pass & fail

 

Vuforia Studio JS Code:

 

$scope.SetStartStagePass = function (width) {
 
var TWXmodelID = 'Camera_UserStats_DT';
    var serviceName = 'GetSummary';
    var d = new Date();
    var parameters = { 'Emp' : $scope.app.params.empID, 'PartNumberInput' : $scope.app.params.partNo, 'Stage' : 'Step-' + j, 'StepValue' : 'Pass', 'DefectInput' : 'NA', 
                      'StepImageInput' :  $scope.view.wdg['camera'].image};
    
    //console.log("Starting UPLOAD using image size " + width);
    twx.app.fn.triggerDataService('Camera_UserStats_DT', serviceName, parameters);
 
}
 
$scope.SetStartStageFail = function (width) {
 
var TWXmodelID = 'Camera_UserStats_DT';
    var serviceName = 'GetSummary';
    var d = new Date();
    var parameters = { 'Emp' : $scope.app.params.empID, 'PartNumberInput' : $scope.app.params.partNo, 'Stage' : 'Step-' + j, 'StepValue' : 'Fail', 'DefectInput' : $scope.app.params.defect, 
                      'StepImageInput' : $scope.view.wdg['camera'].image}; 
    
    //console.log("Starting UPLOAD using image size " + width);
    twx.app.fn.triggerDataService('Camera_UserStats_DT', serviceName, parameters);
 
}

 

Thanks in Advance.

Best answer by Velkumar

Hi @Aditya1702 

 

Instead of logging data into the ValueStream. You can use Stream or DataTable (if it is low-frequency data) to store data in Thingworx which will avoid multiple entries.

 

Please refer here for DataTable services -Data Table Services (ptc.com)

About stream -Streams (ptc.com)

 

/VR

 

 

3 replies

Rocko
19-Tanzanite
March 27, 2024

Did you forget an attachment?

16-Pearl
March 27, 2024

Hi,

Yes I forgot, I am attaching it now.

My purpose is I want to enter records row by row into an infotable.

eg, I have these field definitions in datashape: ID, Name, Status, TimeStamp - I want to enter records for these columns,

Record1: 1, Name1, Pass, 27/03/2024

Record2: 2, Name2, Fail, 27/03/2024

Record3: 3, Name3, Pass, 27/03/2024

 

 

Thanks in Advance.

 

 

19-Tanzanite
March 27, 2024

Hi @Aditya1702 

 

How are logging values in Thingworx ?

 

Are you using Value Stream to do it with log enabled properties ?

 

/VR

4-Participant
April 2, 2024

thanks for sharing

Community Moderator
April 4, 2024

Hello @Aditya1702,

 

It looks like you have some responses from some community members. If any of these replies helped you solve your question please mark the appropriate reply as the Accepted Solution. 

Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Community Moderation Team.

16-Pearl
April 4, 2024

Hello Everyone,

@H_1234 , @Velkumar , @Rocko , @

 

Thank you for your support. I am using Datatable instead of Streams to store records into ThingWorx. Its working properly at present.

 

Best Regards,

Aditya Gupta..