Code for User Interface for 4.2 ???

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

  • Code for User Interface for 4.2 ???

    Hello all,
    Long time listener, first time caller. We're running 4.2 Release and I'm writing a simple User Interface in Visual Basic to allow our operators on the production floor to run our part programs without having the availability to edit/screw them up, but I'm not sure what the code should be that I need to associate the button with, that will open the PC-Dmis application and run a SPECIFIC part program, in PRO mode. There are probably a few different ways to do this. I've looked at the pcdbasic.pdf, but there aren't any code samples for this particular issue and it's a bit confusing anyway. Also, I know that Hexagon sells a Single Touch Interface for about $1700/copy, but we would need 17 licenses, so that's not gonna fly. I tried AllGUI, but apparently it doesn't work with 4.2. Can anyone give me any help with this? Any input would be greatly appreciated. Thanks.
    Tim

  • #2
    I believe Craig runs something similar to what you are developing. He will most likely be around sometime today. Or you could try sending him a Private Message - click on his name and then send him a pm.

    Comment


    • #3
      Well you need to have some knowledge of Visual Basic. And it would depend on which version you are using. Visual Basic 6.0 is different than Visual Basic 2005 Express Edition (which is free and the one you have I assume?). ALLGUI will not work if you are using the express edition because it was written in VB6.0, but the concept is the same. You will have to reference the v4.2 object library to make it work with v4.2 (pcdlrn.tlb file). If you check the help file for "automation" it will have a basic setup or explaination to get you going.
      I used to be high on life but I built up a tolerance.

      Brown & Sharpe Global Advantage
      PCDMIS CAD++ v2011mr2
      PH10MQ/SP600M


      sigpic

      Comment


      • #4
        Tell us what you have so far, how far with your app have you gotten? What version of VB are you using? If it is .net I can share an app with you. Can you post a screenshot of your GUI so I can understand what your interface looks like and how exactly you'd like it to behave.
        <internet bumper sticker goes here>

        Comment


        • #5
          Here is a basic setup to get you started:

          ' Launch PC-Dmis by creating the app object
          Set app = CreateObject("PCDLRN.Application")

          If Not app.WaitUntilReady(300) Then
          MsgBox "Machine did not initialize, Exiting"
          Exit Sub
          End If
          'if you get here, the machine initialized successfuly

          ' Ask the App object for the partprograms object
          Set Parts = app.PartPrograms
          ' Ask the Partprograms object to display the file
          ' open dialog and return the opened part program object
          Set part = Parts.Open("C:\Program Files\WAI\PC-DMIS V42\ip1.prg", "OFFLINE")

          app.Visible = True

          ' Execute the opened part program
          part.EXECUTE
          ' Close the part program
          part.Close
          ' Quit the Application (shut down PC-Dmis)
          ' app.Quit
          I used to be high on life but I built up a tolerance.

          Brown & Sharpe Global Advantage
          PCDMIS CAD++ v2011mr2
          PH10MQ/SP600M


          sigpic

          Comment


          • #6
            Thanks. We're using 4.2 Release on an XP machine. I'm using VB 6.0 to write an executable that opens up a window with 3 buttons on it. Nothing fancy. My intent is to run one of our programs by clicking on one of the buttons. I just don't know what the code should be to associate the button with. If it's deeper than that, one of my coworkers is pretty good at VB, so I can get some help. Do you know if ALLGUI can be altered to work with 4.2/XP? When we tried to run it, we kept getting a "Run-time error '13' Type mismatch" error. I uninstalled the program and reinstalled it and still got the same error. Any suggestions? Thanks again.
            Tim

            Comment


            • #7
              Originally posted by timman View Post
              Thanks. We're using 4.2 Release on an XP machine. I'm using VB 6.0 to write an executable that opens up a window with 3 buttons on it. Nothing fancy. My intent is to run one of our programs by clicking on one of the buttons. I just don't know what the code should be to associate the button with. If it's deeper than that, one of my coworkers is pretty good at VB, so I can get some help. Do you know if ALLGUI can be altered to work with 4.2/XP? When we tried to run it, we kept getting a "Run-time error '13' Type mismatch" error. I uninstalled the program and reinstalled it and still got the same error. Any suggestions? Thanks again.
              Tim
              I have had that when I had a mismatch between the variable in PC-DMIS and the one in VB. Let's say one is an integer, the other a string. Make sure you declare your variables properly.


              Jan.
              ***************************
              PC-DMIS/NC 2010MR3; 15 December 2010; running on 18 machine tools.
              Romer Infinite; PC-DMIS 2010 MR3; 15 December 2010.

              Comment


              • #8
                Originally posted by timman View Post
                Thanks. We're using 4.2 Release on an XP machine. I'm using VB 6.0 to write an executable that opens up a window with 3 buttons on it. Nothing fancy. My intent is to run one of our programs by clicking on one of the buttons. I just don't know what the code should be to associate the button with. If it's deeper than that, one of my coworkers is pretty good at VB, so I can get some help. Do you know if ALLGUI can be altered to work with 4.2/XP? When we tried to run it, we kept getting a "Run-time error '13' Type mismatch" error. I uninstalled the program and reinstalled it and still got the same error. Any suggestions? Thanks again.
                Tim

                You should declare a string and assign that to the path of your file then use that inside the button sub program. I would recommend using a directory list instead of assigning a specific path to each button. If you change the path somehow, you will have to recompile the program because it will be hard coded inside.
                I used to be high on life but I built up a tolerance.

                Brown & Sharpe Global Advantage
                PCDMIS CAD++ v2011mr2
                PH10MQ/SP600M


                sigpic

                Comment

                Related Topics

                Collapse

                Working...
                X