10/6/2010 8:55 PM | |
Joined: 12/11/2009 Last visit: 9/8/2022 Posts: 243 Rating:
|
where are the experts? |
10/6/2010 10:10 PM | |
Joined: 9/27/2006 Last visit: 8/17/2024 Posts: 12278 Rating:
|
Hello Osman; There are 2 ways I know of working with strings and DT variables. if you do not want to create your own FC to handle the conversion of every byte of the DT structure into a string and concatenate the strings with their seprerators. 1) oscat.de offers a free-downloadable set of functions that complement the Siemens instruction set in very interesting areas, math, complex math, double-floating point math, and conversions. One of the functions provided is DT_TO_STRF, and here is how its help is translated (using Babelfish): DT_TO_STRF converts DATE TIME a value into a formatted character string. The problem is that the documentation is German, but the online help is available in English (at least in the version I installed a few years ago). It is worth looking into. 2) Siemens proposes a Tool collection for converting data types: http://support.automation.siemens.com/WW/view/en/25629271 where you will find a function DT_to_String, Converting DATE_AND_TIME to STRING and vice versa. However,the code isnot free, it is sold through the Siemens AVC card, for 120 credits. For information on the AVC, look at http://support.automation.siemens.com/WW/view/en/28446694. Hope this helps, Daniel Chartier |
Last edited by: dchartier at: 10/6/2010 10:12 PMLast edited by: dchartier at: 10/6/2010 10:12 PM |
|
This contribution was helpful to
1 thankful Users |
10/7/2010 9:17 AM | |
Joined: 10/7/2005 Last visit: 8/18/2024 Posts: 3016 Rating:
|
Good question dear Osman_, and one for which I don't have the answer. Perhapsthey areall busy writingthe requested converter Blocks for you, or perhaps - like me - they can't offer youtheir own pre-programmed blocks for this. What I can at least offer you though is a link to www.oscat.de where you will find a Step 7 library(look for "oscat.lib 3.11 Step 7")which at leastcontains a DATE_AND_TIME to String converter Block (Name: DT_to_STRF). While it is programmed in SCL and the corresponding pdf documentation is in German, the code itself is commented in English and may be exactly what you are after (as well as serving as a starting block to develop the other convereter blocks that you need). I hope this helps |
Cheers |
|
This contribution was helpful to
1 thankful Users |
10/11/2010 9:58 AM | |
Joined: 10/7/2005 Last visit: 8/18/2024 Posts: 3016 Rating:
|
Need to bump this thread as I just noticed that THIS thread by Osman_ deals with the samesubject but containsreally good adviseby dchartier. As it turns out Daniels also refers to www.oscat.de BUT came first andposted his answer in the other thread a day beforeI made a similarpost in this thread. Before someone accuses me of plagirism, may I say that this is merely a case of "great minds think alike" (and fools seldom differ, your pick in which category you'd like to place me |
Cheers |
|
12/24/2017 5:58 AM | |
Joined: 7/27/2016 Last visit: 8/16/2023 Posts: 17 Rating:
|
I down load the file from the first link.. but then says it courrpt?
|
7/30/2019 9:35 AM | |
Posts: 17 Rating:
|
Here is a piece of code in SCL i wrote to solve this issue, You can modify the code to do the same for variables of type TOD and TIME, Cheers, AttachmentDT_TO_STRING.txt (3780 Downloads) |
Last edited by: Interlogis at: 07/30/2019 09:39:41 |
|
This contribution was helpful to
12 thankful Users |
Follow us on