Posted 4 Mar 2020 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
Posted 4 Mar 2020 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. Share this post Link to post Share on other sites
Posted 4 Mar 2020 Excellent!!! I will give that a whirl :) Share this post Link to post Share on other sites
Posted 4 Mar 2020 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
Posted 4 Mar 2020 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
Posted 4 Mar 2020 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? Share this post Link to post Share on other sites
Posted 4 Mar 2020 You have the data type LINT for In and it needs to be of type TIME. From the TimeToNanoSec function help file: Share this post Link to post Share on other sites
Posted 4 Mar 2020 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
Posted 4 Mar 2020 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
Posted 5 Mar 2020 Here's another solution. Displaying & Editing a Sysmac NJ Timer Value Share this post Link to post Share on other sites