Page 1 of 1

[?]: S7-300 Convert DateAndTime To String

Posted: Wed Sep 29, 2010 12:34 am
by Pokajy
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)

Re: S7-300 Convert DateAndTime To String

Posted: Wed Sep 29, 2010 2:06 am
by Dreadnoult
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

Re: S7-300 Convert DateAndTime To String

Posted: Thu Sep 30, 2010 8:16 pm
by Pokajy
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)