hexagon logo

PC-DMIS 2012 MR1 & Scripting

Is VB scripting the only form of code to use for pc-dmis 2012 mr1?
  • Is VB scripting the only form of code to use for pc-dmis 2012 mr1?


    Well we usually refer to our PC-DMIS inspection programs as "code".

    If you mean what sort of system can be used to automate and enchance abilities in PC-DMIS, then Cypress Enable Visual Basic is the language utilized.
  • But you can use anything if you can reference the Type Library.

    I use VB6, VB.Net and VB Script
  • Hello,

    My following code was working fine till PC-DMIS 2011 but not working in PC-DMIS 2012.

    Dim App As Object
    Dim Parts As Object
    Dim Part As Object

    Set App = CreateObject("PCDLRN.Application")

    Set Parts = App.PartPrograms

    Set Part = Parts.Open(sFilePath, "CMM1")

    Part.Execute

    Part.Close

    App.Quit
    Set App = Nothing


    what changes I need to do to run it in PC-DMIS 2012?

    Your help is highly appreciated.

    Thanks & Best Regards,
    Pravin
  • You did not indicate what it is or isn't doing. Is there any sort of error message?

    Did you check the sFilePath variable to make sure it is in the proper location now? Since you changed PC-DMIS versions, I wonder if your search paths are correct?
  • You did not indicate what it is or isn't doing. Is there any sort of error message?

    Did you check the sFilePath variable to make sure it is in the proper location now? Since you changed PC-DMIS versions, I wonder if your search paths are correct?



    First of all, Thanks for your reply.
    I have checked path it is correct. the same code is working fine with earlier version. so I believe there is no mistake in code. Is there any chages in tree structure or object. Do you have any idea?

    -Pravin
  • First of all, Thanks for your reply.
    I have checked path it is correct. the same code is working fine with earlier version. so I believe there is no mistake in code. Is there any chages in tree structure or object. Do you have any idea?

    -Pravin


    I do not have any idea right now, not sure if the structure has changed, especially since that program is so simple. Can you tell me if there are any error messages to indicate where the fault is?
  • Like Don says, what isn't working?

    In the code above, sFilePath isn't even set?
  • Ok Let me explain. what is happening in my case.

    First let me clear sFilePath does not have any issue. Because it is defined in function . Private Sub RunProgram(sFilePath As String) Even I have tried using hardcore path "D:\PrbCal.PRG" so Please understand there is no issue in that variable. Path is coming correct in that variable.

    When I run above code, I am not getting any error. PCDMIS 2012 application Open. Even selected program open and after couple of seconds it finishes without doing any inspection/measurement on CMM. It seems like running offline or what.

    Now I hope you both will understand my situation, I am hoping to get any valuable inputs from you to resolve this issue.
  • Given your description of what is happening, I still don't know how to correct it, but I can recommend some tests for debugging purposes. Change the code to something like this -

    Dim App As Object
    Dim Parts As Object
    Dim Part As Object
    Set App = CreateObject("PCDLRN.Application")
    Set Parts = App.PartPrograms
    Set Part = Parts.Open(sFilePath, "CMM1")

    msgbox "Pause for 10 seconds here"

    Part.Execute
    Part.Close
    App.Quit
    Set App = Nothing

    When this runs, the comment will display on the screen. Try waiting for 10 or 15 seconds before you hit ENTER to clear the comment. Maybe there is some sort of timing issue causing a problem. If this tells us anything, we'll try to handle it with a check to make sure the part program object is completely latched before it goes on.