[?]: S7-300 Convert DateAndTime To String

SIMATIC S7-200/300/400, Step7, PCS7, CFC, SFC, PDM, PLCSIM,
SCL, Graph, SPS-VISU S5/S7, IBHsoftec, LOGO ...
Post Reply
Pokajy
Posts: 25
Joined: Mon Apr 07, 2008 3:53 pm
Location: Turkey

[?]: S7-300 Convert DateAndTime To String

Post by Pokajy » Wed Sep 29, 2010 12:34 am

Hi
I have several questions

1- I need to convert dateandtime value to string in plc. Someone have FC for it ?

2- I also need some example blocks to creat strings.
For example MW0=0 MW2=2 MW4=4 I want to creat a string "First value is 0 , second is 2, and last one is 4"
Is it too hard to make it without using SCL ?


3-In wincc, can I display a dateandtime value which is recorded in plc, without exracting it to bytes one by one and without converting it to string in plc side? I mean is there a cscript or something else for it ? I'll creat only one tag for dateandtime value.Script will read P#DB1.DBB0 (8bytes) and display it in IOField as 30/12/2010 22:15:15 )



Thanks for your help (wow)

Dreadnoult
Posts: 12
Joined: Thu Jan 28, 2010 5:15 am
Location: Russia, Sakhalin Island

Re: S7-300 Convert DateAndTime To String

Post by Dreadnoult » Wed Sep 29, 2010 2:06 am

Sorry for my english.
1 Date_And_Time is just an 8 Bytes long array of BCD values. You can convert it to integer, using BTI, then convert INT to STRING, using FC16 from standart library and then concatenate 8 STRING variables in 1.

2 a) Convert MW0,MW2, etc. to STRING b) concatenate it in right order

Pokajy
Posts: 25
Joined: Mon Apr 07, 2008 3:53 pm
Location: Turkey

Re: S7-300 Convert DateAndTime To String

Post by Pokajy » Thu Sep 30, 2010 8:16 pm

thanks but I already knew it.When I read it from sfc1, I saw that every byte includes info.
I'm just looking for example fc.

I'm looking for a string creating example. can u send me some?

Is it only me who needs such type of converting?
I wonder if what people doing when they want to display dateandtime information in scada?

do they write ........./....../....... ......:.....:..... then they're putting 6 IOFields :) ??

Ok Nobody needs it. How about Time or TOD informations? Forexample you have 20 Time informations recorded in plc. How do you display them in scada? do you write ......:.......:.... then u're putting 3IO Fields? For now I have found a cscript it takes decimal time value and converts its to time then display it in page. but this is not good way because if you have 30 time values in same screen, then pc speed goes down.

(dlink) (sbutton) (boom)

Post Reply