Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing LOGO timer values from Virtuino
#1
Hi,
I need to change the timer value frommy Virtuino project to Logo.
I have defined the VM, the block has address 44, on the Logo program. I have then added a Value Display widget connected to VM and a pop up windows to enter the value.
Everything works fine but with an issue, I am only able to change the minutes and not the hours.
The Logo block has the hh:mm format and the only changing value is minutes up to 100. If I input 65 minutes I can read 01:05 hours on Logo that is correct but the visualization in Virtuino project still read minutes.

Any suggestions on how to solve this problem?

Thanks a lot!!


Attached Files Thumbnail(s)
           
Reply
#2
Hi,
I think you have to convert the time to minutes.
If you use the "Time counter" it is very easy.
The default output of the "Time counter"  is in seconds.
Go to the Timer settings window.
On the bottom find the field "Time measurement unit".
On the drop down line select the second choice (minutes).
Due to a bug the choises are not visible enough

If you use another time you have to use the "Math script" for this convertion 
Enter as x-input the timer output variable
Enter as output the ariable you want to send to logo
Multiply the input with the number 60
Enter as script this:  x*60
Reply
#3
(06-29-2023, 12:57 AM)iliaslamprou Wrote: Hi,
I think you have to convert the time to minutes.
If you use the "Time counter" it is very easy.
The default output of the "Time counter"  is in seconds.
Go to the Timer settings window.
On the bottom find the field "Time measurement unit".
On the drop down line select the second choice (minutes).
Due to a bug the choises are not visible enough

If you use another time you have to use the "Math script" for this convertion 
Enter as x-input the timer output variable
Enter as output the ariable you want to send to logo
Multiply the input with the number 60
Enter as script this:  x*60

Thanks for your suggestion, I will try it later today. 
I have just figured out that I have the same problem in the other way round, I want to visualize the running hours but I can only see it in minutes (e.g. It shows 65 minutes for 01:05 hours). 
Maybe your suggestion also works for this?
Reply
#4
(06-29-2023, 05:54 AM)GianniPower Wrote: Hi,
I think you have to convert the time to minutes.

Thanks for your suggestion, I will try it later today. 
I have just figured out that I have the same problem in the other way round, I want to visualize the running hours but I can only see it in minutes (e.g. It shows 65 minutes for 01:05 hours). 
Maybe your suggestion also works for this?

Hi,
you don't make it clear to me whether you want this display to be done in the application or in the PLC
Reply
#5
(06-29-2023, 08:01 PM)iliaslamprou Wrote:
(06-29-2023, 05:54 AM)GianniPower Wrote: Hi,
I think you have to convert the time to minutes.

Thanks for your suggestion, I will try it later today. 
I have just figured out that I have the same problem in the other way round, I want to visualize the running hours but I can only see it in minutes (e.g. It shows 65 minutes for 01:05 hours). 
Maybe your suggestion also works for this?

Hi,
you don't make it clear to me whether you want this display to be done in the application or in the PLC

Hi, 
Sorry if I wasn't clear. 
I want to send the value from application to plc.
In a different widget I want to see the timer running time but I can only get the value as a decimal, for example 16,75 hours
Reply
#6
(06-30-2023, 10:55 AM)GianniPower Wrote: Hi, 
Sorry if I wasn't clear. 
I want to send the value from application to plc.
In a different widget I want to see the timer running time but I can only get the value as a decimal, for example 16,75 hours

Yes you can.
The app can convert a variable in seconds or milliseconds  to time formated value.

In this video: https://virtuino.com/downloads/videos/time.mov
the variable V0 contains a number that can be displayed as seconds or as time with format  hh:mmConfuseds or hh:mm.
Using a script you can convert the seconds of the variable V0 to minutes or any other value you want to send to PLC.
You have to replace the Emulator 1 with the PLC variable. The every time you change the time the app will send the converted value to PLC.
This happens because the value is stored in the 0 as milliseconds or seconds.
I hope to help you
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)