Timebombing a change

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Timebombing a change

    Does anyone know of a way to timebomb a change?
    Say I want to make an assignment to change a tolerance for a specific amount of days, then revert to the original tolerance.

    Code:
    ASSIGN/START_DATE=SYSTEMDATE("MM")*SYSTEMDATE("dd")
    ASSIGN/END_DATE=36-START_DATE
    Start_date is multiplying the month times the day
    end date is the number of days from the beginning of the year minus the current number of days that have elapsed.
    Last edited by BKulpa; 01-29-2020, 08:21 AM. Reason: One possible solution for a short term

  • #2
    If/End If comment with a variable? If date=> (date) Assign tol=****, if date< (date) Assign tol=**** ?

    Just spitballing here but that's my first thought.
    Remembering my beautiful wife Taz who's life was lost on 6-13-2020. I love you and I miss you.

    Comment


    • #3
      If you use an ISO format for dates, you can just compare today against limits with >= and <=, and use the fact that TRUE is 1 and FALSE is 0.

      Example:

      Code:
      ASSIGN/MOD_VALID_FROM="20200128"
      ASSIGN/MOD_VALID_TO="20200204"
      
      ASSIGN/CURDAT=SYSTEMDATE("yyyyMMdd")
      
      ASSIGN/V1=(CURDAT>=MOD_VALID_FROM)
      ASSIGN/V2=(CURDAT<=MOD_VALID_TO)
      ASSIGN/MOD_VALID=(V1) AND (V2)
      
      DIM LOC2= LOCATION OF CIRCLE CIR10 UNITS=MM ,$
      GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
      AX NOMINAL MEAS +TOL -TOL DEV
      D 9.900 9.900 0.100[COLOR=#e74c3c]+MOD_VALID*0.1[/COLOR] -0.100[COLOR=#e74c3c]-MOD_VALID*0.1[/COLOR] 0.000 ----#----
      END OF DIMENSION LOC2
      I split up the condition to make it easier to read, it could of course be a single ASSIGN
      Code:
      ASSIGN/MOD_VALID=(CURDAT>=MOD_VALID_FROM) AND (CURDAT<=MOD_VALID_TO)

      Edit: But this is quite a dangerous thing to do, all to easy for anyone to change the MOD_VALID_TO to have the larger tolerance back after it has expired...
      Last edited by AndersI; 01-29-2020, 08:58 AM.
      AndersI
      SW support - Hexagon Metrology Nordic AB

      Comment


      • BKulpa
        BKulpa commented
        Editing a comment
        ASSIGN/MOD_VALID=(CURDAT>=MOD_VALID_FROM) AND (CURDAT<=MOD_VALID_TO)

        I'm not following what type of evaluation is being performed here.

      • AndersI
        AndersI commented
        Editing a comment
        That's why I showed it split up in the original code. The first part checks that TODAY is on, or after, MOD_VALID_FROM, the second part checks that it's on, or before, MOD_VALID_TO. Each half will get the value 0/1 (FALSE/TRUE). Combining them with AND will still give a value 0/1 which is used as multiplier on the tolerance modification part.

    Related Topics

    Collapse

    Working...
    X