WKTilton

Timer modification from HMI

10 posts in this topic

A simple request for an Omron novice.  I know Timer values in Sysmac Studio are classified as TIME variables.  How can I modify the Preset of a TON block from my NA HMI since the TON Preset is of a TIME data type?

Thanks,

Share this post


Link to post
Share on other sites

I created a couple of functions that will convert REAL to TIME (in seconds) and another that will convert TIME (in seconds) to REAL. I used REAL because I wanted to input a set point in fractional seconds and respectively view the elapsed time in fractional seconds. I guess I should have called it REAL_TO_SEC. You can scale the function to whatever units you wish to enter.

Mr_PLC_REAL_TO_TIME.JPG.9b00606696237ff2Mr_PLC_REAL_TO_TIME_Example.JPG.93cba301 

Share this post


Link to post
Share on other sites

Excellent!!!  I will give that a whirl :)

Share this post


Link to post
Share on other sites

I'm struggling......I  get compilation errors about non-existant variables so I right-click to register each one.  I think I have it figured out which ones are 'internal', 'input' & 'output'...

I screwed up and accidentally selected 'Generate all POU variables in Internal'.....how do I UNDO that?  Is there a place these variables are stored I can delete and start over?

 

I did get the TIME_TO_REAL to compile up to 'Conversion of LINT to TIME is impossible'.....don't know what to do with that one :?

Share this post


Link to post
Share on other sites

Nevermind about the variables....I found where they are....but not sure about the "Conversion....." error

Share this post


Link to post
Share on other sites

Ok, here is what I have for that Function Block.....and I get the Conversion Impossible error....

I do create this as a 'Function Block' correct?

time to real.PNG

Share this post


Link to post
Share on other sites

You have the data type LINT for In and it needs to be of type TIME.

From the TimeToNanoSec function help file:

TimeToNanoSec.thumb.jpg.6c70d05e34d0673f

Share this post


Link to post
Share on other sites

I see what I did wrong now....appreciate the help....also had it in Function Block when I needed it in Functions :?

Thanks again....

Share this post


Link to post
Share on other sites

Yes, this can be a function.  The way you know function vs function block is if it is required to "remember" anything from the past.  

Easy examples:

Out = In +5   This would be a function as you will always get the same answer no matter what you put into it.  

Out = increment of internal counter each time In turns on -  This would be a function block as it would need to "remember" the value of the internal counter and the answer is different each time it executes.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now