Jump to content

Recommended Posts

Posted

I can't for the love of me found how to convert a RTC date into a string, to keep it in a data table or a struct.

Timestamping! How is it possible in UniLogic?

Can I somehow pack the RTC into a string like "26/Sep/2014" and store that string or RTC Struct in a data table? Or is there some special kind of struct I can use for this?

Posted

Yeah, but that's a custom function and seems like an overkill.

Vision had a built-in "Numeric to Bytes" function which worked fine. There must be something  similar in Unilogic.

  • MVP 2023
Posted
3 minutes ago, kvlada said:

There must be something  similar in Unilogic.

There is not.  There are quite a few functions in Vision that don't exist in UniStream.   PWM and Linearize Array immediately come to mind.

The thing about a function in Vision is you don't know what the assembly code looks like under the hood to get that function to work.  We got spoiled by some of that stuff.

Here's the RTC to ASCII udfb I lifted from the example programs.  Looking through it gives us an indicator of what kind of somersaults the Vision programmers performed for that function.  You can call it overkill if you wish.  But it does work.

Joe T.

RTC to ASCII V2.ulle

Posted

I had the same problem few days ago, since I wanted to write date as string for future database use.
Just like Joe said, just import that function and call it. I made both strings 15 in lenght.

BR E.P.

RTC.png

Posted

The function works alright.

I've also made my own function with creates a full timestamp string using two calls to RTC to ASCII v2.

rrr.png

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.