Тёмный

SIEMENS TIA PORTAL Datalogging - How to read and write data in CSV? 

Automation Online
Подписаться 693
Просмотров 30 тыс.
50% 1

This video shows how to write and read from CSV File in Tia Portal

Наука

Опубликовано:

 

28 май 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 15   
@wabetosilva2481
@wabetosilva2481 7 месяцев назад
Terrific!!!! Very good explanation works very well 😃😃😃
@slavaleb378
@slavaleb378 2 месяца назад
Cool! Thanks a lot!
@afreetunesian
@afreetunesian Год назад
Thanks for the The Tuto ! verry helpful. a question: it is possible to add a VB fuction to the project without adding the wincc like in your Exemple. is that possible to make a short tuto for it ? thanks!
@Rivuzza
@Rivuzza Год назад
with this script I can directly create a csv file on the pc without the hmi panel, right? where to insert the vb file since the script folder is not present
@umbertosala3232
@umbertosala3232 Год назад
Very usefull! Bravo! Is it possible to create a new file when you change batch?
@rafo21pe
@rafo21pe 4 месяца назад
how many variables can be set in the trend ?
@ramazancan507
@ramazancan507 Год назад
Hello, thank you for your sharing. How can I save data in different file month by month?
@mohamedel-shamy1945
@mohamedel-shamy1945 2 месяца назад
Really Good Question, I'm waiting for the Answer
@user-wc3oy4bx1l
@user-wc3oy4bx1l Год назад
sir how to read in between line data's
@user-mp4mb8ph9e
@user-mp4mb8ph9e Месяц назад
it does't work with real HMI (tp 900 comfort)
@remigelin4076
@remigelin4076 2 года назад
can you give the program ? (a copy paste in the comments is enough)
@automationonline
@automationonline 2 года назад
'***************** Write data to CSV File************************* Sub VBFunction_1() ' Write_data_to_file Dim fso, f, ts 'Catch errors On Error Resume Next Datetime = Now() 'Create object Set fso = CreateObject("Scripting.FileSystemObject") If Err.Number 0 Then ShowSystemAlarm "Error #" & CStr(Err.Number) & " " & Err.Description Err.Clear Exit Sub End If ' If no file exists, create a new one If Not fso.FileExists(FileName) Then fso.CreateTextFile FileName End If Set f = fso.GetFile(FileName) If Err.Number 0 Then ShowSystemAlarm "Error #" & CStr(Err.Number) & " " & Err.Description Err.Clear Exit Sub End If Set ts = f.OpenAsTextStream(8, -2) ' mode "8" to append to file If Err.Number 0 Then ShowSystemAlarm "Error #" & CStr(Err.Number) & " " & Err.Description Err.Clear Exit Sub End If ' Write new set of values into file ts.WriteLine(Material & ";" & Pressure & ";" & Temperature & ";" & Datetime) 'Tidy up ts.Close Set f = Nothing ShowSystemAlarm "Storage of the data was successful!" End Sub ' ********Read data from CSV File****************************** Sub VBFunction_4() ' Read_data_from_file() Dim fso, f, field, MyZf ' Catch errors On Error Resume Next ' Create file object Set fso = CreateObject("Scripting.FileSystemObject") If Err.Number 0 Then ShowSystemAlarm "Error #" & CStr(Err.Number) & " " & Err.Description Err.Clear Exit Sub End If Set f = fso.OpenTextFile(FileName, 1, 0, -2) If Err.Number 0 Then ShowSystemAlarm "Error #" & CStr(Err.Number) & " " & Err.Description Err.Clear Exit Sub End If ' Read values till end of file Do While Not f.AtEndOfStream MyZf = f.ReadLine Loop field = Split(MyZf, ";") MaterialFromFile = field(0) PressureFromFile = field(1) TemperatureFromFile = field(2) ' Tidy up fso.Close Set f = Nothing Set fso = Nothing ShowSystemAlarm "Readout of the data was successful!" End Sub '**********************************************************
@alexandremarinho2582
@alexandremarinho2582 Год назад
@@automationonline It's possible search 25/10/2022 value in column ex :"A"(date), and show values B and C in tags. same like this vlookup. A | B | C | 10/10/2022 | 102.0 | 99.5 | 25/10/2022 | 102.0 | 99.5 |*** 28/10/2022 | 102.0 | 99.5 |
@kiyo191
@kiyo191 Год назад
hello . Can I have the source code please?
Далее
SIEMENS TIA PORTAL - DATABASE SCRIPTING
15:18
Просмотров 6 тыс.
S7-1200 Data logging Siemens PLC
18:08
Просмотров 206 тыс.
Китайка Шрек всех Сожрал😂😆
00:20
script for create csv file on siemens hmi tp1200
38:04
WInCC Runtime advance - Write data to Excel file
8:43
TIA Portal: The four different PLC Memory Areas
18:14