Technical Forum

SIMATIC WinCC (TIA Portal)

Need a Tag with Time and/or Date

Thread Starter: ch0k0pe   Started: 6/27/2012 12:36 AM   Replies: 4

« Previous thread Next thread »
Page 1 of 1 (5 items)
  6/27/2012, 12:36 AM
Joined 10/20/2011
Last visit: 5/14/2013
Posts: 19
Rating:
Rated: Outstanding [4 out of 5 / rated 1 time(s)]. (1) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 

As my subject says, i need a tag that can display me the time and/or the date. Previously i was using WinCC V7.0 and i could create a time and date tag with a system channel. Now that im using WinCC V11 i cant find a way to do this.
I found a clock element, and turn it into digital, maybe i can get this clock date and time and move it into a tag??
I need to get this information into another tag because im using UserArchive and need to insert the time and date into the table.
TY

Top
  6/27/2012, 1:21 PM
Joined 9/5/2011
Last visit: 5/17/2013
Posts: 2549
Rating:
Rated: Outstanding [3.83 out of 5 / rated 131 time(s)]. (131) 
Users with special expertise supervising conferences
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hello,

You see how you can read out the local computer time in the FAQ.

How can you read out, display or set the local computer time or the coordinated world time in WinCC Runtime Professional?

Tweety
Top
  6/27/2012, 6:17 PM
Joined 10/20/2011
Last visit: 5/14/2013
Posts: 19
Rating:
Rated: Outstanding [4 out of 5 / rated 1 time(s)]. (1) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
With this i can get the time display into an object, this meaning that i can assign a tag to the object but when i try reading the tag i get a blank value.
Right now im using C-Scripts, so i use the function settagchar, gettagchar from this tag but i cant get the time/date to get readen because i get a blank value.
My question is, is there a way i can get the time displayed into a tag in order to write it on userarchives on certain time?
Top
  6/28/2012, 1:56 PM
Joined 9/5/2011
Last visit: 5/17/2013
Posts: 2549
Rating:
Rated: Outstanding [3.83 out of 5 / rated 131 time(s)]. (131) 
Users with special expertise supervising conferences
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hello,

you can write the time in an internal tag of Data type "string".
time --> string
you can use this VBs script.

Dim test
test = Time()
SmartTags("time").Value = CDate(test)

HMIRuntime.Trace(SmartTags("time").Value)

Tweety
Top
  6/29/2012, 1:26 AM
Joined 10/20/2011
Last visit: 5/14/2013
Posts: 19
Rating:
Rated: Outstanding [4 out of 5 / rated 1 time(s)]. (1) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Got it working now, TY Tweety
Top
Page 1 of 1 (5 items)
Actions