09-10-2012 01:04 PM - edited 09-10-2012 01:14 PM
Is there a control to convert a timestamp into a byte array. I have a cluster payload with 7bytes of data that I need to load with month,day,year,H,M,S. I'm using the Format-Date Time function to get each individual time/date setting. Now I need to convert each string to a numeric byte. If I typecast each string to a U8 I get the ASCII value versus the actual value. There has got to be an easier way of doing this. Any ideas?
Thanks...
09-10-2012 01:13 PM
Hey,
Is it the String to Byte Array function you are looking for?
Be careful with your terminology. Controls and indicators are front panel objects and exist on the block diagram as terminals. The yellow colored blocks are called functions and exist on the block diagram.
Kind Regards
09-10-2012 01:20 PM
The String to Byte Array function won't work, since it returns the ACSI Value of the string data. For example if I extract the month from the timestamp which is say 8, I need the string value converted to a numeric 8 not the acsi value for 8. So what I need is a string to INT in numeric form. I could subtract the ACSII value out, but I'm sure there's a function to do this 😃
Thanks again.
09-10-2012 01:27 PM
09-10-2012 01:32 PM
Exactly 😃 Thanks so much!
09-10-2012 03:12 PM
There's actually a function called Seconds to Date/Time which will give you direct access to the time record in terms of month, year, day, etc. without requiring you to do any string parsing. It should be much more robust. Is this what you need? The function is in the main Timing palette.
09-10-2012 11:27 PM
Hi QRP,
I think this will work for you.
09-11-2012 07:33 AM
@danil33 wrote:
Hi QRP,
I think this will work for you.
As much as I like seeing somebody re-post my code, I think Jarrod has the correct answer in this case.