Dear Community User! We have started the migration process.
This community is now in READ ONLY mode.
Read more: Important information on the platform change.

cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

C++: Print Hello World, save it to .csv and download it?

C++: Print Hello World, save it to .csv and download it?

Josaphat_Aviles
Established Member

I created a .csv file, where/how I can download?

 

Thanks in advance!

7 REPLIES 7

Sgilk
Frequent Contributor

Hello @Josaphat_Aviles ,

Could you please provide some more information? From the post title, it sounds like you have written an application in c++ that writes some data to a .csv file.

1. Where is the c++ application running?

2. Where are you trying to save/download the .csv file to?

Hello @Sgilk,

I build a snap of C++, using your template of Hello world. I already receive data from a cRIO, and save it by default in the same location path(in a csv file).
Then... I can visualize the information in Diagnostics >> Logbook. But I can not download the csv.

Do I have to storage in a specific url? Like this one: "/var/snap/rexroth-solutions/common/solutions/activeConfiguration/"

For example the only documentation that I found similar to storage csv files is this one:

https://developer.community.boschrexroth.com/t5/Store-and-How-to/Transferring-and-Representing-CSV-F...

Josaphat_Aviles_0-1703109756806.png

 

But I can not find something with C++. 😥

 

 

Sgilk
Frequent Contributor

If you are looking to download the .csv through the ctrlX OS web interface, it will need to be saved to the active configuration. You can also save to the WebDav directory and access the files via a WebDav client. The third option would be to save locally to external storage uSD or USB. Any examples should transfer across languages fairly well because most of this configuration is in the snap build pipeline rather than the logical source code.

--- See Persisting Configurations.

--- See WebDav GO Example.

--- See Storage Extension.

1. Where is the c++ application running?
R: Ctrlx 7

2. Where are you trying to save/download the .csv file to?
R:Ctrlx7

There is a lot of informacion but with JSON, nothing wit C++, Is there some video or example? Is quite general info.

Sgilk
Frequent Contributor

JSON is simply a standard of encoding data in a human readable format. It can be used with any programming language.

You wrote that you have already generated the .csv file in your c++ application? All you need to do at this point is save that file in one of the locations I listed in the previous comment, and make sure you have the necessary configurations in your package manifest.

If you are using C++, see these libraries: filesystem, fstream

Please let me know if you have any more specific questions. I'm sorry I don't have a full example for your use case.

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist