hexagon logo

PC-DMIS 2012 MR1 & Scripting

Is VB scripting the only form of code to use for pc-dmis 2012 mr1?
Parents
  • I think the "CMM1" is the culprit - at least in my installations, the machine name is a translated word, "Maskin1", not "CMM1".


    That is definitely a good catch, but I suspect it is not the problem. In early version of PC-DMIS, the argument was "CMM1", and then later it was decided that since PC-DMIS could be interfaced to other machine types. The argument was modified to accept the more generic "Machine1", but in reality both arguments are acceptable. I just tested it here in 2012 MR1 and they both worked for that version. Here is the code I used -


    Private Sub Form_Load()
    Dim App As PCDLRN.Application
    Dim Parts As PCDLRN.PartPrograms
    Dim part As PCDLRN.PartProgram

    Set App = CreateObject("PCDLRN.Application")
    If Not App.WaitUntilReady(300) Then
    MsgBox "Machine Init taking too long"
    Exit Sub
    End If

    Set Parts = App.PartPrograms
    App.Visible = True

    Set part = Parts.Open("C:\Program Files\WAI\PartPrograms\Test.prg", "Machine1")

    part.EXECUTE
    part.Close
    Set part = Nothing
    Set Parts = Nothing
    App.Quit
    Set App = Nothing
    End

    End Sub
Reply
  • I think the "CMM1" is the culprit - at least in my installations, the machine name is a translated word, "Maskin1", not "CMM1".


    That is definitely a good catch, but I suspect it is not the problem. In early version of PC-DMIS, the argument was "CMM1", and then later it was decided that since PC-DMIS could be interfaced to other machine types. The argument was modified to accept the more generic "Machine1", but in reality both arguments are acceptable. I just tested it here in 2012 MR1 and they both worked for that version. Here is the code I used -


    Private Sub Form_Load()
    Dim App As PCDLRN.Application
    Dim Parts As PCDLRN.PartPrograms
    Dim part As PCDLRN.PartProgram

    Set App = CreateObject("PCDLRN.Application")
    If Not App.WaitUntilReady(300) Then
    MsgBox "Machine Init taking too long"
    Exit Sub
    End If

    Set Parts = App.PartPrograms
    App.Visible = True

    Set part = Parts.Open("C:\Program Files\WAI\PartPrograms\Test.prg", "Machine1")

    part.EXECUTE
    part.Close
    Set part = Nothing
    Set Parts = Nothing
    App.Quit
    Set App = Nothing
    End

    End Sub
Children
No Data