Skip to main content
16-Pearl
Mar 27, 2024 5:05 AM UTC
Solved

Property values are repeating while using QueryPropertyHistory Service in ThingWorx

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.

VelkumarAnswer
19-Tanzanite
Mar 28, 2024 7:57 AM UTC

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

 

 

30 replies

Rocko
19-Tanzanite
Mar 27, 2024 12:57 PM UTC

Did you forget an attachment?

Translate
16-Pearl
Mar 27, 2024 1:04 PM UTC

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.

 

 

Translate
Velkumar19-TanzaniteAnswer
19-Tanzanite
Mar 28, 2024 7:57 AM UTC

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

 

 

Translate
4-Participant
Apr 2, 2024 12:26 PM UTC

thanks for sharing

Translate
Community Moderator
Apr 4, 2024 5:08 AM UTC

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.

Translate
16-Pearl
Apr 4, 2024 5:42 AM UTC

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..

Translate