Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Now that we have a valid dataset, we want to export it as a .csv file, which can be imported into ThingWorx Analytics in a future guide to generate an analytical model.
An easy way to do this is with the CSV Parser Extension, which you’ll now import.
1. Download the CSV Parser Extension from our third party provider IQNOX.
Note: An account is required but the download is free.
2. At the bottom-left, click Import/Export.
3. On the drop-down, click Import.
4. For Import Option, select Extension.
5. Click Browse and navigate to the extension you downloaded above.
6. Click Open.
7. Click Import.
8. Click Close.
9. On the Refresh Composer? pop-up, click Yes.
ThingWorx Foundation uses File Repositories to read and write files from disk (including .csv files created by the CSV Parser Extension).
In this step, we’ll create a File Repository Entity.
1. Return to Browse > All.
2. Click MODELING > Things.
3. Click + New.
4. In the Name field, type ESDS_File_Repository.
5. If Project is not already set, search for and select PTCDefaultProject.
6. In the Base Thing Template field, search for and select FileRepository.
7. At the top, click Save.
We have imported an Extension which gives us tools to manipulate .csv files. We have created a File Repository to which the export can save the file. We'll now make use of some of this new functionality.
We’ll do so by creating a Service which calls built-in functions of the CSV Parser Extension.
1. Return to EdgeThing.
2. Click Services.
3. Click + Add.
4. On the drop-down, select Local (JavaScript).
5. In the Name field, type exportCSVservice.
6. In the blank JavaScript field, copy-and-paste the following code:
var sFile = "vibrationCSVfile.csv";
var paramsCSV = {
path: sFile,
data: me.infoTableProperty,
fileRepository: "ESDS_File_Repository",
withHeader: true
};
Resources["CSVParserFunctions"].WriteCSVFile(paramsCSV);
7. Click Save and Continue.
We now have all the tools in place to export the infoTableProperty as a .csv file to our new File Repository.
All that’s left is to call the appropriate functions.
1. Ensure that you’re still on the Services tab of EdgeThing, and have the exportCSVservice open.
2. At the bottom, click Execute.
3. Return to ESDS_File_Repository.
4. Click Services.
5. Scroll down and find the GetFileListingsWithLinks Service.
6. Click the “Play” icon for Execute service.
7. At the bottom-right, click Execute.
8. On the right, click Thingworx/FileRepositories/ESDS_File_Repository/vibrationCSVfile.csv.
9. The .csv export of the vibration data will now be in your local folder to which your browser saves downloads.
Congratulations! You've completed the Engine Simulator Data Storage guide, and learned how to:
The next guide in the Vehicle Predictive Pre-Failure Detection with ThingWorx Platform
learning path is Build an Engine Analytical Model
We recommend the following resources to continue your learning experience:
Capability | Guide |
Analyze | Build a Predictive Analytics Model |
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 |