4/21/2010 5:30 PM | |
Posts: 23 Rating: (0) |
Hi I want to assign the Timer value(TV) for example s5t#10h20m30s via wincc please help me best regards |
4/22/2010 12:36 PM | |
Joined: 1/4/2010 Last visit: 3/19/2024 Posts: 650 Rating: (40)
|
Hi do you want set the time of an S7 controller from WinCC? Please have a look in this FAQ. http://support.automation.siemens.com/WW/view/en/7802886 |
Last edited by: Romulus at: 4/22/2010 12:37 PMRegards |
|
4/22/2010 2:12 PM | |
Joined: 9/27/2007 Last visit: 12/18/2020 Posts: 993 Rating: (102)
|
Hi All Informations you need, you find in the Help of SIMATIC Manager under Index: S5TIME. There you find, that 10 hours is not possible (max. 9990 seconds). regards cumulus |
Learn more about visualization - visit the HMI courses of Siemens AG! |
|
4/27/2010 5:32 PM | |
Joined: 9/27/2007 Last visit: 12/18/2020 Posts: 993 Rating: (102)
|
Hi here is function which returns aS5TIME. Theformat of the parameter is "intTime" is "00h00m00s000ms". That shoud have all you need. [code]Function SetS5Time (Byval inpTime) Dim TimeInMS, TimeBaseNum Dim ms, s, m, h Dim pos Dim Stat_ms Dim Bt0, Bt1, Bt2, Bt3, S5Time 'inpTime = "01h45m30s230ms" HMIRuntime.Trace(inpTime & vbCrLf) 'extract h,m,s,ms pos = InStr(inpTime,"ms") ms = Mid(inpTime,pos-3, 3) pos = InStr(inpTime,"s") s = Mid(inpTime,pos-2, 2) pos = InStr(inpTime,"m") m = Mid(inpTime,pos-2, 2) pos = InStr(inpTime,"h") h = Mid(inpTime,pos-2, 2) 'Calculate time in ms TimeInMS = 3600*h*1000 + 60*m*1000 +s*1000 + ms If (Int(TimeInMS/10)*10)< TimeInMS Then MsgBox "*" &inpTime & "* is not corect - mind. steps in 10ms - function abort",vbCritical Elseif(Int(TimeInMS/100)*100)< TimeInMS Then 'HMIRuntime.Trace("Selected Timebase: 10ms" & vbCrLf) If TimeInMS/10 > 999 Then MsgBox "*" &inpTime & "* Time-range to big - max. 9s 990ms in steps of 10ms possible - function abort",vbCritical Exit Function End If TimeInMS = (TimeInMS * 0.1) TimeBaseNum = 0 Elseif (Int(TimeInMS/1000)*1000)< TimeInMS Then 'HMIRuntime.Trace("Selected Timebase: 100ms" & vbCrLf) If TimeInMS/100 > 999 Then MsgBox "*" &inpTime & "* Time-range to big - max. 1m 39s 900ms in steps of 100ms possible - function abort",vbCritical Exit Function End If TimeInMS = TimeInMS/100 TimeBaseNum = 1 Elseif (Int(TimeInMS/10000)*10000)< TimeInMS Then 'HMIRuntime.Trace("Selected Timebase: 1s" & vbCrLf) If TimeInMS/1000 > 999 Then MsgBox "*" &inpTime & "* Time-range to big - max. 16m 39s in steps of 1s possible - function abort",vbCritical Exit Function End If TimeInMS = TimeInMS/1000 TimeBaseNum = 2 Else 'HMIRuntime.Trace("Selected Timebase: 10s" & vbCrLf) If TimeInMS/10000 > 999 Then MsgBox "*" &inpTime & "* Time-range to big - max. 2h 46m 30s in steps of 10s possible - function abort",vbCritical Exit Function End If TimeInMS = TimeInMS/10000 TimeBaseNum = 3 End If 'HMIRuntime.Trace("TimeBase: " & TimeBaseNum & " Time: " & TimeInMS & vbCrLf) Bt0 = Round((TimeInMS/10 - Int(TimeInMS/10))*10,0) Bt1 = Round(Int(TimeInMS/10)-(Int(TimeInMS/100)*10)) Bt2 = Int(TimeInMS/100) Bt3 = TimeBaseNum 'Calaculate and return return S5TIME S5Time = Bt3 * 2^24 + Bt2 * 2^16 + Bt1 * 2^8 + Bt0 SetS5Time = S5Time End Function [/code] regards cumulus |
Learn more about visualization - visit the HMI courses of Siemens AG! |
|
This contribution was helpful to1 thankful Users |
4/28/2010 8:31 PM | |
Posts: 23 Rating: (0) |
Hi cumulus thanks alot for reply but i have one question How should i use this function? please tell me step by step? |
4/29/2010 3:56 PM | |
Joined: 9/27/2007 Last visit: 12/18/2020 Posts: 993 Rating: (102)
|
Hi
p.E
[code] Sub InputValue_OnPropertyChanged(ByVal Item, ByVal value) End Sub [/code] |
Learn more about visualization - visit the HMI courses of Siemens AG! |
|
This contribution was helpful to1 thankful Users |
5/10/2010 6:25 PM | |
Posts: 23 Rating: (0) |
Hi How should i use the return value (S5TIME) in my S7 program? |
8/4/2014 11:30 PM | |
Joined: 9/1/2005 Last visit: 3/5/2024 Posts: 4097 Rating: (193) |
new question published byKarnanis split to a seperate thread with the subject Convert the value to S5T# format Best regards CS Moderator |
My Forum is the place to personalize your profile, |
|
Follow us on