Skip to main content

3 replies

mstarnaud
16-Pearl
June 10, 2024

Hi Lo_ry

 

I'm not sure what you mean. Do you just want the current time in Thingworx and send it to Influx? If so, you can look into those 2 lines of code :

var TestVariable1 = new Date();
var TestVariable2 = (new Date()).getTime();

Then you can use those variables and send them as parameters to the service that inserts the data in Influx. You can then decide which is the best format for your needs.

 

Please let us know if one of those solves your issue. And if not, can you provide more details on what you're trying to accomplish.

Rocko
19-Tanzanite
June 11, 2024

You could also use configure ThingWorx to use Influx as persistence provider and make the properties logged, then they are already in Influx.

For this you need to make yourself familiar with Persistence Provider and Value Stream concepts. Both are documented in the help,

https://support.ptc.com/help/thingworx/platform/r9.5/en/#page/ThingWorx/Help/Composer/DataStorage/PersistenceProviders/using_influxdb_as_The_persistence_provider_2.html#

https://support.ptc.com/help/thingworx/platform/r9.5/en/#page/ThingWorx/Help/Composer/DataStorage/ValueStreams/ValueStreams.html#

 

Try also check out the Iot_Tips section in the community.

https://community.ptc.com/t5/IoT-Tips/tkb-p/tkb_iottips

 

 

Community Moderator
June 12, 2024

Hi @Lo_ry96,

 

I wanted to follow up with you on your post to see if your question has been answered. 
If so, 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 that we can continue to help you. 

 

Thanks,
Anurag