Micro800 Time to String in usable format

SME

Member
Join Date
Sep 2016
Location
Mildura
Posts
9
Hello Guys,

Im struggling to find an easy way (Hoping for a UDFB) or simple alternative
to take a TIME value (time remaining from a timer) and put in the middle of STRING text to send as an SMS.

I have got the sms and the inserting string valve into a string sorted,
However I cant insert time as it is into a string, and everything i convert it to is in an unusable format

I found the hard way, To convert to a DINT then /1000 to get seconds, then /60 for Min, then /60 for hours
Then its about another 6 rungs of code to get into a usable format to insert as a string
however I have to do a lot of these and its a LOT of code and memory
There must be an easier way someone has come up with?

Any ideas

Thanks
Shaun
 
Are you using the Micro800 to send the SMS or will a different device be what actually sends the sms message?

Have you tried the Any to String function block that Rockwell provides?
 
Last edited:
Hi Damica1

Yes a Micro820
From NHP you can buy in a kit comes with
-Micro 820
-Power supply
-2080-SERIALISOL (Serial plug in module)
The Micro comes pre-programed with some code to get you started
-SmartSAM4T 3G/4G Modem
-Antenna

I cant use the any-to-string
It just spits out an unusable figure
 
RTC_Read function block will return the "Date/Time" into UINT. Now just convert each output into a string with "any to string" function then merge into a single string.

This should work!
 
This is not done or tested but I think it may help with getting you what you need.

Localvars picture shows the local variable that I used. The ladder shows how I might flow the program.

Once I got everything working as I needed I would create a UDFB so that all I had to do was to drop on a rung input a couple of variable and the end result is at hand.

Hope this helps, have a great day.

LocalVars.jpg Ladder.jpg
 
Hi David,

Thank you for that, looks simpler than what i came up with I wish i had have seen this first. Thanks for the reply, I might have a play with this new info!

However I couldn't use for a timer value it wouldn't let me.
Have a look at my UDFB if you want
Cheers

https://drive.google.com/drive/folders/1Yy-G970mM4twCHF378W454Jl-2kQNnMK?usp=sharing

view


view
 
Last edited:

Similar Topics

Hi All, I am having trouble converting a real to string and keep it to 2 decimal places. I'm sure its a simple solution. Any help is appreciated
Replies
2
Views
262
My company built a small test machine using a Micro800 PLC and CCW software. We chose the Micro800 because the machine is very simple. We are...
Replies
2
Views
135
Hi, Is there a way to set the IP of a micro dynamically, based on a variable value.?
Replies
0
Views
155
Anyone use the newer 2080-L50E or L70E with 1734 Point IO yet? I have a customer asking for a setup and I have not found anyone that has done...
Replies
0
Views
366
Is there a way to download the program to a Rockwell Micro810 without using the Rockwell CCW application?
Replies
5
Views
717
Back
Top Bottom