kvlada Posted April 15 Report Posted April 15 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?
ORSO2001 Posted April 15 Report Posted April 15 hi kvlada, did you check the examples where the "num to string" UDFB is?
kvlada Posted April 15 Author Report Posted April 15 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 Joe Tauser Posted April 15 MVP 2023 Report Posted April 15 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
Easy Pete Posted April 16 Report Posted April 16 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.
kvlada Posted April 17 Author Report Posted April 17 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.
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