Jump to content

Recommended Posts

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

  • MVP 2014

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:

post-16-005459700 1313710273_thumb.jpg

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

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:

post-16-005459700 1313710273_thumb.jpg

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

post-1695-037509500 1313711295_thumb.jpg

Link to comment
Share on other sites

  • MVP 2014

You need the num to ASCII function.

post-16-027264500 1313711839_thumb.jpg

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

You need the num to ASCII function.

post-16-027264500 1313711839_thumb.jpg

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.

post-1695-063626900 1314012238_thumb.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...