Kkula
Hi Guys,
Situation I am in:
I have a SIMATI HMI (TP700 Comfort & using V13 of TIA), the HMI logs data from the PLC.
I want to be able to save the logged data onto a remote PC, but I would like the saved name of the file to be unique I.E. the date.
I also need the file to save when a tag value is true (boolean)
I don't have a great deal of experience in VBA, im still learning. Can anyone help me?
Thanks in advance,
Oli
Hi Oli,
You can achieve this using a combination of HMI data logging, VBA scripting, and potentially Windows scripting (like a scheduled task or a simple script triggered by file creation). Here’s a breakdown of how to approach this:
Shell object to execute a xcopy or robocopy command). This will copy the log file. Ensure the remote PC is accessible over the network and that the HMI has the necessary permissions.Example VBA Snippet (Conceptual):
Sub TransferLogFile()
Dim strDate As String
Dim strLogFileName As String
Dim strRemotePath As String
strDate = Format(Now, "YYYYMMDD")
strLogFileName = "HMI_Log_" & strDate & ".csv" ' Or your log file extension
strRemotePath = "\\RemotePC\SharedFolder\" & strLogFileName
' Example using Shell to execute xcopy (adjust paths as needed)
Shell "xcopy ""C:\Siemens\WinCC\Logs\YourLogFile.csv"" " & strRemotePath, vbNormalFocus
End Sub
Important Considerations:
Start with a simple test to verify file transfer before implementing the full logic. Good luck!
Best regards,
Siemens Self Support
Our flexible community website is a platform that allows users to connect, share information, and collaborate on various topics of interest. The website offers a range of features such as discussion forums, messaging, user profiles, event calendars, and more. Users can customize their experience by creating and joining different groups or communities based on their interests or location. The website is designed to be user-friendly and adaptable to the needs and preferences of our diverse user base. Whether you are looking to network professionally, share hobbies and interests, or simply connect with like-minded individuals, our flexible community website has something for everyone. Join us today and become a part of our thriving online community!
India
Copyright ©2025
Share this page with your family and friends.