S7 300 date or time to ascii

Well, there might be a function in the Simatic Library that already does that. It would be worth a look.

If you want to roll your own (and I would), all you would have to do is take each digit of the time and convert it to ASCII and construct a string. For instance, the number 7 is 55 in ASCII (just add a 48 to the number).

There are other threads here that describe the date/time format, and those would help you with the digit conversions.
 
Hi,
Thanks fo the info,
Just found Siemens support file #6175489 "converting DATE_AND_TIME into STRING and vice versa"

Thanks again

Trerank
 

Similar Topics

I set the Date and Time of the S7 300 PLC equal to that of my PG. But after a few days I found that the date and time were not what they should...
Replies
0
Views
1,911
Hi Guys. Is it possible to read out the automatic calculated PN update time in a S7-300? In most cases we use the "automatic calculated update...
Replies
0
Views
1,254
Ok then guys after a lot of looking around for an answer on this subject i feel very dizzy and amazed it appears so hard to be able to create a...
Replies
18
Views
14,909
Dear All, i want to know how we Date and Time set and Change from HMI MP277 use Wincc Flexible.PLC is S7 300 CPU 315 2-DP.i use SFC0,SFC1 but...
Replies
4
Views
5,710
Hello I have simple home automation made with Siemens S7-300 series. It consist of CPU 315-2 DP, Digital inputs (321),outputs (322), relays and...
Replies
1
Views
2,335
Back
Top Bottom