Record time ran min/sec


#1

Is there an easier way to record how long something has been on other than ripping apart Time$ and using math. I need a running stopwatch really.
My PLC is giving me total values but only when the input shuts off, if something ran all day I would not get any live totaling values so I am working on writing the script to check and refresh every 10 seconds or so to give me an updated runtime.


#2

Hi Lucas,

I think I found a way to do this, I created a couple of int tags along with a string tag that will be combining the variables of hours, minutes and seconds. I’d probably set it up so that it runs on an onchange so that when you run on the machine it will start counting and have it reset to 0 otherwise.

runtime counter.txt (974 Bytes)


#4

This is perfect i just changed it to run every second automatically, then, we check if other variables go high, each one will start a count for me. This brings me to the second part of this. I need to add more tags to this design I am working on and need to add tags faster. I downloaded the tag generator excel file from here but it does not seem to upload to the ewon, only download the tags to the computer.


#5

Generally I don’t recommend that people use the tag generator just because it’s not something that was developed by HMS. But it is possible to do this through excel or notepad.

I’d recommend going into filezilla and grabbing both of the var_lst files and then downloading them like below

If you open it in excel and select one of the cells, you can go to Data > Text to Columns > Delimited > Semicolon > General > Finish. After this it should spread out and show you all of the variables that are available for you to set.

Once you do that I’d go onto the notepad doc and add the new tags while using the excel sheet as a reference. After that is done, you can upload it back onto the flexy. Or if you have the add on for excel, there is a way to concatanate and transpose the cells so that it will merge them back with the semicolon between them afterwards


#6

That worked perfectly!

Filezilla is a very powerful and a must have for any advanced users of the eWON.
Torn apart your timer code and its now counting for 4 different inputs if any one changes, at midnight the values are reset and each value can now be zeroed at any point during the day.
The one other I was having was with a variable in TSET 1,A% ill post another topic for this though, that way I keep my posts on point with the original topic.

Thanks again Tim


#7

Welcome,

Let me know if you have any other questions