585,761 active members*
4,126 visitors online*
Register for free
Login
Page 1 of 2 12
Results 1 to 20 of 25
  1. #1
    Join Date
    Nov 2006
    Posts
    174

    System variables

    Anyone know the system variables for the current time and date on Okuma OSP P200M control?

  2. #2
    Join Date
    May 2011
    Posts
    27
    Quote Originally Posted by ChattaMan View Post
    Anyone know the system variables for the current time and date on Okuma OSP P200M control?
    VPMNT 0-59 minute counter cleared every hour
    VRMNT minute counter not cleared
    VPHUR 0-23 hour counter cleared every day
    VRHUR hour counter not cleared
    VQDAT 0- number of days

  3. #3
    Join Date
    Nov 2006
    Posts
    174
    Cheers Maxter. I saw that in the manual but didn't understand the difference. Your explanation is much clearer :-)

  4. #4
    Join Date
    Nov 2006
    Posts
    174
    Hmm. Any idea where the resulting figures come from. At 8:35am this morning results were....
    VPHUR=1 and VPMNT=19??
    I expected (hoped)it to be
    VPHUR=8 and VPMNT=35
    Can this "counter" be set to zero manually?

  5. #5
    Join Date
    Apr 2006
    Posts
    822
    ah yes the good old hunt for 'system time' on an Okuma!
    Good luck with that! After hunting for years, I am yet to find the answer to this question.
    As far as I know, there is NO system variable that will give you the time as in it is now 8:36am on 1/11/2012.
    The system variables listed above are read only I think... i.e. not able to be 'reset'.
    What are you trying to achieve?
    These variables are usually set to ZERO on power on.
    Cheers
    Brian.

  6. #6
    Join Date
    Nov 2006
    Posts
    174
    I have set up the prog to save updated offsets after probing. The probed offsets are written to a new file. On subsequent runs this file is overwritten with the updated data. I just wanted to put a time stamp on the bottom of the file.
    I know the time the file was created would be correct but just wanted to add the time stamp too. If an operator opens the file and inadvertently edits (presses any key) the saved file would now show a different time that it was created.

  7. #7
    Join Date
    Nov 2012
    Posts
    24
    The variable to read the windows system time is VTIME[1] through VTIME[6]

    VTIME[1] = year
    VTIME[2] = month
    VTIME[3] = day
    VTIME[4] = hour
    VTIME[5] = minute
    VTIME[6] = second

    The following code will output to a file using READ WRITE GET PUT

    CLOSE C
    FWRITC MD1:TIME-DATE.TXT;A
    PUT' '
    WRITE C

    (TIME DATE)
    PUT' '
    WRITE C
    PUT 'YEAR/MM/DD'
    PUT VTIME[1]
    PUT '/'
    PUT VTIME[2]
    PUT '/'
    PUT VTIME[3]
    WRITE C
    PUT 'TIME'
    PUT VTIME[4]
    PUT':'
    PUT VTIME[5]
    WRITE C
    CLOSE C

  8. #8
    Join Date
    Nov 2006
    Posts
    174
    Ooo that looks interesting. I'll try that on Monday when I'm back at work. Broby will be pleased.

    :-)

  9. #9
    Join Date
    May 2011
    Posts
    27
    Quote Originally Posted by YoDoug View Post
    The variable to read the windows system time is VTIME[1] through VTIME[6]

    VTIME[1] = year
    VTIME[2] = month
    VTIME[3] = day
    VTIME[4] = hour
    VTIME[5] = minute
    VTIME[6] = second

    The following code will output to a file using READ WRITE GET PUT

    CLOSE C
    FWRITC MD1:TIME-DATE.TXT;A
    PUT' '
    WRITE C

    (TIME DATE)
    PUT' '
    WRITE C
    PUT 'YEAR/MM/DD'
    PUT VTIME[1]
    PUT '/'
    PUT VTIME[2]
    PUT '/'
    PUT VTIME[3]
    WRITE C
    PUT 'TIME'
    PUT VTIME[4]
    PUT':'
    PUT VTIME[5]
    WRITE C
    CLOSE C
    Very nice YoDoug! I have the 'full' list of system variables for this control given to me from an Okuma rep and VTIME wasn't on the list! I tried the code and it works! I wound up reducing the spaces in the TXT file like this: PUT VTIME[1],4

  10. #10
    Join Date
    Apr 2006
    Posts
    822
    well I'll be stuffed!
    In all the 'time' I have been hunting for this information, no-one has stated these variable names!
    WELL DONE to YoDoug!
    I have tried it on our MA600HB with OSP E100M Controller and stuff me, it worked!
    There was a small strange output with the minutes and seconds in that the minutes output was not accurate, the time was 12:43pm and I was getting the answer of 45. I then waited until the time was 12:45 and the answer was 45... ok obviously then 12:46 and the answer was still 45!
    Had a similar problem with the seconds not displaying accurate information as well.
    I wonder how often these variables get updated?
    will have to run a program in a loop to see what happens over a period of time.
    I will let you know how it pans out.
    Cheers
    Brian.

  11. #11
    Join Date
    Nov 2012
    Posts
    24
    I have never tried the VTIME variables on a control older than a P100. I work for an Okuma distributor so I mostly work on new machines.

  12. #12
    Join Date
    Nov 2006
    Posts
    174
    Tried the VTIME thingy today. Brilliant, just brilliant.
    It finishes off my saved probed offsets just as I wanted them.
    Thanks. :cheers:
    Attached Thumbnails Attached Thumbnails probesave.jpg  

  13. #13
    Join Date
    Apr 2006
    Posts
    822
    Quote Originally Posted by ChattaMan View Post
    Tried the VTIME thingy today. Brilliant, just brilliant.
    It finishes off my saved probed offsets just as I wanted them.
    Thanks. :cheers:
    Damn fine looking stuff there!
    Well done.

  14. #14
    Join Date
    Nov 2006
    Posts
    174
    Quote Originally Posted by broby View Post
    Damn fine looking stuff there!
    Well done.
    Yes, with help from you too.
    Thanks.

  15. #15
    Join Date
    Jun 2008
    Posts
    372
    I tried these on a P200L lathe with no luck, Does anybody know the Lathe variables for this?

  16. #16
    Join Date
    Nov 2006
    Posts
    174
    Today I came across the VTIME function in the programming manual. So I just needed to look harder before, didn't I...!

    So I looked for it in the Multus manual (P200L control) but couldn't find it. And I tried it out in MDI...V1=VTIME[1]....and it alarmed out. "TIME" not recognised.
    So sorry to say, budgieW, it looks like it won't work.

    Unless someone knows different

  17. #17
    Join Date
    May 2011
    Posts
    27
    Quote Originally Posted by ChattaMan View Post
    Today I came across the VTIME function in the programming manual. So I just needed to look harder before, didn't I...!

    So I looked for it in the Multus manual (P200L control) but couldn't find it. And I tried it out in MDI...V1=VTIME[1]....and it alarmed out. "TIME" not recognised.
    So sorry to say, budgieW, it looks like it won't work.

    Unless someone knows different
    Same story here guys... works on my P200M control but not on the Multus P200L control.

  18. #18
    Join Date
    Apr 2006
    Posts
    822
    Quote Originally Posted by Maxter View Post
    Same story here guys... works on my P200M control but not on the Multus P200L control.
    Yet another obvious example of how the "Mill Control" team and the "Lathe Control" team have no clue what each other are doing!
    About damn time Okuma actually worked together as a "Team" and got some consistency across all control systems.
    Same as VC1 accesses common variable 1 on a Mill but on a Lathe, oh no... you have to use V1! grrrrrrrrr.:tired:

  19. #19
    Join Date
    Nov 2012
    Posts
    24
    Update: On mills that do not have the VTIME variable available you can use the following code to convert the VQDAT variable into day/month/year. The VQDAT variable is not in lathe controls so no help there.


    AY=4716
    AJ=1401
    AM=2
    AN=12
    AR=4
    AP=1461
    AV=3
    AU=5
    AS=153
    AW=2
    AB=274277
    AC=-38
    JUL=VQDAT + 2444238

    AF = JUL + AJ
    AF = AF + [[[4 * JUL + AB]/146097] * 3]/4 + AC
    AE = AR * AF + AV
    AG1 = MOD[AE,AP]/AR
    AH = AU * AG1 + AW
    DAY = FIX[[MOD[AH,AS]]/AU + 1]
    MNTH = FIX[MOD[AH/AS + AM,AN] + 1]
    YEAR = FIX[AE/AP - AY + [AN + AM - MNTH]/AN]

    VC1=DAY
    VC2=MNTH
    VC3=YEAR

  20. #20
    Join Date
    Apr 2006
    Posts
    822
    Quote Originally Posted by YoDoug View Post
    Update: On mills that do not have the VTIME variable available you can use the following code to convert the VQDAT variable into day/month/year. The VQDAT variable is not in lathe controls so no help there.


    AY=4716
    AJ=1401
    AM=2
    AN=12
    AR=4
    AP=1461
    AV=3
    AU=5
    AS=153
    AW=2
    AB=274277
    AC=-38
    JUL=VQDAT + 2444238

    AF = JUL + AJ
    AF = AF + [[[4 * JUL + AB]/146097] * 3]/4 + AC
    AE = AR * AF + AV
    AG1 = MOD[AE,AP]/AR
    AH = AU * AG1 + AW
    DAY = FIX[[MOD[AH,AS]]/AU + 1]
    MNTH = FIX[MOD[AH/AS + AM,AN] + 1]
    YEAR = FIX[AE/AP - AY + [AN + AM - MNTH]/AN]

    VC1=DAY
    VC2=MNTH
    VC3=YEAR
    Holy Crap Batman!
    How the heck did you come up with that set of formula?
    Brain hurts just reading it.
    Cheers
    Brian.

Page 1 of 2 12

Similar Threads

  1. System variables
    By dinglekiller in forum Parametric Programing
    Replies: 6
    Last Post: 10-15-2012, 09:14 AM
  2. System Variables
    By zooloader in forum Mori Seiki lathes
    Replies: 3
    Last Post: 08-02-2012, 03:53 AM
  3. System variables
    By cncwhiz in forum Fanuc
    Replies: 6
    Last Post: 01-18-2008, 05:27 AM
  4. System variables in a O-MD
    By AZDEN in forum Fanuc
    Replies: 1
    Last Post: 10-23-2007, 04:50 PM
  5. System variables
    By jorgehrr in forum G-Code Programing
    Replies: 8
    Last Post: 02-19-2007, 02:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •