Checking Tip Calibration Date

  • Time
  • Show
Clear All
new posts

  • Checking Tip Calibration Date

    I was wondering if anyone out has an example of checking how many days have elapsed since tip calibration was last performed? Basically I was thinking of using the PROBEDATA("DATE", ) and SYSTEMDATE() commands to find the calibration date and current date but then I'm not sure how to go about getting the difference. I did this in the past using VB in a MeasureMax program but VB had a built in command to get the difference.
    I know I can set the number of days within the probe calibration window but this is for a shop floor machine and I want something that will abort the part program and force them to run the tip calibration program before they can continue. I am under the impression that the PC-DMIS function just issues a warning but they could go ahead and continue running the program.
    I thought somebody had recently posted what I am looking for but after searching for two days I still haven't found anything. Any help would be greatly appreciated.

    Is it okay to listen to AM radio in the afternoon?

  • #2
    You will have to create a basic script program to do the calculation.

    The dateserial command comes to mind, but it wont be as simple as VB. I dont think that there are actual basic commands that allow "Date" math. Maybe a VB program that you call as an external program.

    Has anyone passed any command line parameters to an external program yet?
    Links to my utilities for PCDMIS


    • #3
      I've passed string variables from PCDMIS directly to a to a sub in a .bas script but never a date format variable. I have found the simplest way to pass stuff is to pass it to a .bas then write to a .txt for reading back into PCDMIS or just straight up write it from PCDMIS to a .txt then execute the .bas and have the .bas do what it needs to do then have PCDMIS read it in when the .bas is done executing. Otherwise you have to get the running instance of PCDMIS for automation. Reaing and writting to .txt files is brainless and both VB and PCDMIS can dispose of the file when you are done with it plus you don't run into automation issues as they work independently.

      Command line stuff no I've never done it but I think Don Rugierri (sp? sorry Don) has.

      <internet bumper sticker goes here>


      • #4
        I have looked at the basic scripting and saw that you could pass values to the script. But when I look at the example it is shown as a SUB not a FUNCTION. Can this be done as a function where the script or .bas would return a value such as boolean??
        Links to my utilities for PCDMIS


        • #5
          I hope so because I was thinking of writing a function to do the array sort that someone else was having trouble with accomplishing in PCDMIS. I am only hoping though, I haven't had much time for testing "extra curicular" stuff lately so I can't say when I'll get to it. The only problem is passing it back to PCDMIS. Have you ever automated the running instance of PCDMIS that is in the middle of a part program? Can a .bas do that? You'd have to get the running instance's current (running) part program and redraw a variable with the information that you are passing back. That is what I have been avoiding trying by using a .txt file as a broker so-to-speak. Let me know what you find out.

          <internet bumper sticker goes here>


          • #6
            According to the help, you can execute a script and retrieve the value of a variable from the PCDMIS side and then set the value to something different.

            Has anyone used this?
            Sub Main
            Dim App As Object
            Set App = CreateObject ("PCDLRN.Application")
            Dim Part As Object
            Set Part = App.ActivePartProgram
            Dim Var As Object
            Set Var = Part.GetVariableValue ("V1")
            Dim I As Object
            If Not Var Is Nothing Then
            Var.LongValue = Var.LongValue + 1
            "V1", Var
            MsgBox "V1 is now: " & Var
            Msgbox "Could Not find variable"
            End If
            End Sub
            Links to my utilities for PCDMIS


            • #7
              I am currently trying to use that code and I have a problem with it. When I do the Part.SetVariableValue command to carry data back to PC-DMIS, it likes to error out. Sometimes it works, most of the time it doesn't. However, it ALWAYS works when in operator mode. Go figure that.

              Anyone else had any luck with this?



              • #8
                WOW! We had that same problem at almost the same time. Scary. Anyway I solved it

                I noticed that once you get an error any changes you make still throw an error. You have to make the changes, then exit the program then you are fine. The operator mode thing is puzzling though.

                Last edited by craiger_ny; 09-28-2006, 04:09 PM.
                <internet bumper sticker goes here>


                Related Topics