Jump to content

display a variable to hour format


Recommended Posts

Hello,

I have an issue with my project, i have 11 variables which are the result of several counter time. The values are displayed as a second format and im trying to display these variables like this : HH:MM:SS.

I try to do it through the block "Time to Ascii", it works for one variable but when i try to do it for a second one it doesnt work (the display is weird and doesnt respect the HH:MM:SS format). I send 2 pictures of my issue

Thanks if anyone can help me and sorry for my english, im french.

https://zupimages.net/viewer.php?id=22/16/f89z.jpg

https://zupimages.net/viewer.php?id=22/16/civy.jpg

 

 

 

Link to comment
Share on other sites

  • MVP 2023

The Time to ASCII function returns a string that is stored in a vector of MIs. There are 2 characters stored in each MI. You must assign a vector long enough to handle all 8 characters (possibly plus a Null?). In your picture it looks like you're stepping on your vector.

Link to comment
Share on other sites

Thanks for your answers Flex,  you were right my vector wasnt long enough

If someone else need  i figured out , when my first variable changed i saw that my second one was overwritten by the change, I just spaced out the addresses of my variables and it works for exemple every 2, MI 0 so MI 2 .... i decided to swap to ML just in case

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