Jump to content

RTC to ASCII: Those Pesky Separators

Recommended Posts

The function "RTC to ASCII" is potentially useful. It would be more useful if one could get rid of the "/" separator in the MM/DD string and the ":" separator in the hh:mm string.

I can move RTC to ASCII into three consecutive MI's. I suppose I could then move ASCII to NUM. The documentation for ASCII to NUM says that you specify a Source Vector address, a Vector Length, and a Destination Vector. (there's also something called a Factor, but that's to do with decimals, so I'm guessing that stays at zero.

If there are two ASCII characters per MI, then the ASCII data laid out is:




MI x+1 /D

MI x+2 D

What would be ideal would be to move this all to 5 consecutive Integers, say, MI Y0 through Y4, then grab Y3 and Y4 and then put them on Y2 and Y3. This would kill the ASCII code for "/". Then I could grab Y0 through Y3 and put them in an ASCII set, e.g. MI Z0 and MI Z1.

This would all be irrelevant if I could go RTC to String and then just knock out character 3, but that option doesn't seem to exist.

Am I completely off base? I want to make a filename that consists of MMDDhhmm.udt on the SD card. That way, every time we create a new .udt file, we can immediately see the date and time of file creation. But I can't do this if I can't strip out the separators, because we can't exceed 8 characters.

Any ideas welcome. The examples and documentation don't cover this, in my experience.

Fred Mason

Link to comment
Share on other sites

  • MVP 2023

It's a bit convoluted, but I would suggest building your MMDDhhmm number in an ML and then doing a NUM to ASCII on it.

SI 32 contains DDMM, so the first thing to do is divide it by 100 to knock it to DD only. The remainder MM will be in SL 4, so you can multiply it by 100 and add it back resulting in MMDD. Next multiply this by 10,000 and put it in an ML to get MMDD0000. Add SI 31 HHMM to this ML to get MMDDHHMM. Now when you run it through the NUM to ASCII block with length 8 you should get your string in four consecutive MIs.

Joe T.

Link to comment
Share on other sites

Hi Guys,

You can use the String tools to create any string you want. This is part of the beauty of them.

Here is an example program that takes the RTC to ASCII for the date and the time, Removes the "/" from the date and the ":" from the Time, then truncates the strings down to four chars, and then merges the two strings creating your file name.


It is also worth mentioning, that we added a few new formats to the RTC to ASCII to support files names (legal file name chars are numbers, letters and the "_").


string tools to make file name MMDDhhmm.vlp

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.

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...