JohnnyB Posted August 18, 2011 Report Share Posted August 18, 2011 Hi Guys I have a database and i will save it in SD-CARD. I need create a vector for use date (dd-mm-yy) in the datasheet. My application is a counter. If value is more than X the function save data table. After one cicle, the format for datasheet will (dd-mm-yy 1, dd-mm-yy 2, dd-mm-yy 3 ..........). I could not create a function for this function. I tried use load SI 32 (Store) to MI and also use function RTC to ASCII but i don´t find a function for convert this value to string or ascII - My doubt is also in this step. Thanks for attention. Link to comment Share on other sites More sharing options...
MVP 2014 Simon Posted August 18, 2011 MVP 2014 Report Share Posted August 18, 2011 The RTC to ASCII has a format for dd/mm/yy, but you need to scroll down to the bottom of the list to see it. See screenshot below: If you need the format dd-mm-yy instead of dd/mm/yy then some further manipulation will be required. I haven't done much with them myself, but the Strings functions seem to provide just about every option you need to achieve this without too much programming. Link to comment Share on other sites More sharing options...
JohnnyB Posted August 18, 2011 Author Report Share Posted August 18, 2011 The RTC to ASCII has a format for dd/mm/yy, but you need to scroll down to the bottom of the list to see it. See screenshot below: If you need the format dd-mm-yy instead of dd/mm/yy then some further manipulation will be required. I haven't done much with them myself, but the Strings functions seem to provide just about every option you need to achieve this without too much programming. Hi Mr Simon, Many Tanks for you prompt response. I tried use this function, but i could not add a the Count after the date value. Ex.: 18/08/2011 1 ; 18/08/2011 2, 18/08/2011 2. This counter i have in a MI. What function i can use for attach this count in ASCII values (from date). Is possible i attach the ASCII value for date and time to use in datasheet name ? Best Regards Link to comment Share on other sites More sharing options...
MVP 2014 Simon Posted August 19, 2011 MVP 2014 Report Share Posted August 19, 2011 You need the num to ASCII function. To create a string of date then number, just put the results in adjoining MI locations. In my screenshot the RTC to Num puts its result in MI0...3 then it puts a Null in MI4 to terminate the string. If we tell the num to ASCII to put its result in MI4, then that now becomes part of the date string. Also, to put the space in between the date and the number, use the "leading spaces" option on the num to ascii and also set the "Result String length" parameter to be longer than your number. For example if you are only going to have 1 digit, then set the result string length as 2, set Leading Spaces, and you will get a space in front of the number. If you want more spaces, just increase the Result String Length further. I hope this helps. Link to comment Share on other sites More sharing options...
JohnnyB Posted August 22, 2011 Author Report Share Posted August 22, 2011 You need the num to ASCII function. To create a string of date then number, just put the results in adjoining MI locations. In my screenshot the RTC to Num puts its result in MI0...3 then it puts a Null in MI4 to terminate the string. If we tell the num to ASCII to put its result in MI4, then that now becomes part of the date string. Also, to put the space in between the date and the number, use the "leading spaces" option on the num to ascii and also set the "Result String length" parameter to be longer than your number. For example if you are only going to have 1 digit, then set the result string length as 2, set Leading Spaces, and you will get a space in front of the number. If you want more spaces, just increase the Result String Length further. I hope this helps. Mr Simon Your tip work fine. Now, i use the format dd/mm/yy hh:mm. For space between date and hour i create a string with 02 spaces(MI09). Many tanks for this help. Have a good day. Link to comment Share on other sites More sharing options...
MVP 2014 Simon Posted August 23, 2011 MVP 2014 Report Share Posted August 23, 2011 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now