(0)| 3/24/2025 9:43 AM | |
|
Joined: 11/3/2021 Last visit: 9/15/2025 Posts: 104 Rating:
|
Hello, I have the same problem. I have used the snippets: TIA Portal V19 Unified Basic S7 1500 PLC Here is my Code: HMIRuntime.FileSystem.WriteFile("/media/simatic/X61/Textfile.txt", "my utf8 string", "utf-8").then( function() { HMIRuntime.Trace("Write file finished successfully"); }).catch(function(errorCode) { HMIRuntime.Trace("Write failed errorcode=" + errorCode); }); Let Tag1 = Tags("Value[1]. Test" ).Read(); HMIRuntime.FileSystem.AppendFile("/media/simatic/X61/Textfile.txt", "Added : " + Tag1 + "\n", "utf-8").then( function() { HMIRuntime.Trace("Write file finished successfully"); }); Its on Event "Pressed" at a Button. The file has been created. But it is empty. I would be thankful for help ------------------------------------------------------------------------------------------ |
Last edited by: Lowe21X at: 03/24/2025 09:46:59Last edited by: Moderator_Lan at: 03/24/2025 11:37:23New subject after splitting |
|
| 3/24/2025 11:20 AM | |
|
Joined: 1/21/2013 Last visit: 12/30/2025 Posts: 4371 Rating:
|
Hi Lowe21X, The problem is probably caused by the captured file contents not being transferred to the USB device before it is removed. Unfortunately, the WinCC Unified devices do not yet provide a secure method for ejecting a storage medium. However, as the writing is done with JavaScript, the Linux 'sync' command should be able to write the data bugger to the device. So you should call the command using the 'StartProgram' method. Kind regards |
| 3/24/2025 2:10 PM | |
|
Joined: 1/21/2013 Last visit: 12/30/2025 Posts: 4371 Rating:
|
Hi Lowe21X, See the post by user WouterKUL. In my opinion, it should work without the need to create a bash script, just by using sync as the program name in the StartProgram method, but to be honest, I have never tested this. Kind regards |
Follow us on