Jump to content

Recommended Posts

Posted

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,


Posted

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 

Posted

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 :?

Posted

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

Posted

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.

Posted
On 3/4/2020 at 9:13 PM, IO_Rack said:

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 

On 3/4/2020 at 9:13 PM, IO_Rack said:

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 

Hi. All: 

1. The function block
2. Global Variables
3. Ladder

All these three need to write in plc? sorry im kinda blurrr. 

Currently I want enter the point value in HMI NA5 and convert it to Time(sec) in plc.

Posted

There are instructions in the PLC to convert seconds to time, and nanoseconds to time.

You can put a numeric edit on the screen to adjust a number of seconds, and then feed that into the SEC_TO_TIME function that is built-in, and the output is in the TIME data type.

The NA can actually display data type TIME, so displaying the current value of the timer is easy.

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
×
×
  • Create New...