Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
Now that we have a place to permanently store the values coming from the EMS engine simulator,
we'll write a Service to take samples and place them within the Info Table.
Part of that Service, though, will be incrementing the identifier, so we'll need to create one last Property.
With all the pieces in place, we can now create our Service to add entries to our Info Table Property.
We now have called the function which will add a row of information to the Info Table Property, one entry for each column of the formatting Data Shape.
We just need to specify which values go into which column.
identifier:me.identifier,
Because we want the identifier in the stored data to increment on each run, and we want to start the count at 1 (and the Default Value is 0), add the following line to the top of the Service:
me.identifier=me.identifier+1;
low_grease:me.low_grease,
s1_fb1:me.s1_fb1, s1_fb2:me.s1_fb2, s1_fb3:me.s1_fb3, s1_fb4:me.s1_fb4, s1_fb5:me.s1_fb5,
s2_fb1:me.s2_fb1, s2_fb2:me.s2_fb2, s2_fb3:me.s2_fb3, s2_fb4:me.s2_fb4, s2_fb5:me.s2_fb5 });
You completed Service should look like the following:
me.identifier=me.identifier+1; me.infoTableProperty.AddRow({ identifier:me.identifier, low_grease:me.low_grease, s1_fb1:me.s1_fb1, s1_fb2:me.s1_fb2, s1_fb3:me.s1_fb3, s1_fb4:me.s1_fb4, s1_fb5:me.s1_fb5, s2_fb1:me.s2_fb1, s2_fb2:me.s2_fb2, s2_fb3:me.s2_fb3, s2_fb4:me.s2_fb4, s2_fb5:me.s2_fb5 });
With our Service completed, let's run it to store a sampling of the data coming from our EMS Engine Simulator.
You now have not only an Engine Simulator that is constantly sending data from a remote EMS, but a way to permanently record data at points that you deem significant.
Feel free to return to the Service and call it several more times. Each time, the values coming from the Engine Simulator will be stored in another entry in the Info Table Property.
Congratulations! You've successfully completed the Use the EMS to Create an Engine Simulator guide, and learned how to:
The next guide in the Vehicle Predictive Pre-Failure Detection with ThingWorx Platform
learning path is Engine Simulator Data Storage.
We recommend the following resources to continue your learning experience:
Capability | Guide |
Build | |
Build | Implement Services, Events and Subscriptions |
If you have questions, issues, or need additional information, refer to:
Resource | Link |
Community | Developer Community Forum |
Support | Analytics Builder Help Center |