hexagon logo

Badge Scan for Employee

Hello All,

Is there any line of code i can enter to make PC-DMIS search for an ID number inside an excel file or something? The reason i ask is we have been having unauthorized users using the CMM without training and we want to be able to hold them accountable. We would also like for that same transaction to be able to place there info into the report as well in case they are using someone else badge because they don't have training to hold them both accountable.

Parents
  • we had a similar issue with non-CMM users logging into the cmm while it was running, causing PC-Dmis to stop. we had IT set up to only allow people added to our "CMM users" group to even be able to log in to the PC attached to a cmm.  if thats not an option you can use "tracefields" and operator inputs to populate a variable and group it the "collapse the group. that variable can be added to the PDF or excel report as well.

    L1 =LABEL/
    USER =COMMENT/INPUT,NO,FULL SCREEN=NO,
    Insert Operator Name:
    ASSIGN/USER1=USER.INPUT
    TRACEFIELD/DISPLAY=NO,REPORT=NO,DISPLAY MESSAGE=USER ; USER : USER1
    IF_GOTO/USER1==0,GOTO = L1

    or add a script

    assign the variable in pcdmis 1st

    ASSIGN/OPER=""

    Sub Main()
    Dim PCDApp, PCDPartPrograms, PCDPartProgram

    Set PCDApp = CreateObject("PCDLRN.Application")
    Set PCDPartPrograms = PCDApp.PartPrograms
    Set PCDPartProgram = PCDApp.ActivePartProgram
    Dim Cmds As Object
    Dim Cmd As Object
    Dim objFSO, objShell
    Dim objFile, objFolder As Object
    Dim SubPath As String
    Dim a,b As Integer
    Set Cmds = PCDPartProgram.Commands

    'operator Name
    user$ = InputBox$(" Operator Name:", "Insert Operator", "", 200, 175)

    For Each Cmd In Cmds
    If Cmd.Type = ASSIGNMENT Then
    If Cmd.GetText(DEST_EXPR, 0) = "OPER" Then
    bln = Cmd.PutText("""" + user$+ """", SRC_EXPR, 0)
    End If
    End If
    Next Cmd

    End If
    Next Cmd

    ' Cleanup
    Set PCDPartProgram = Nothing
    Set PCDPartPrograms = Nothing
    Set PCDApp = Nothing
    End Sub

    this will pass back the users input to the variable and you can report it or concatenate it into the name of the program as ran and set a "secret" location to auto save the .PRG for later review if needed

Reply
  • we had a similar issue with non-CMM users logging into the cmm while it was running, causing PC-Dmis to stop. we had IT set up to only allow people added to our "CMM users" group to even be able to log in to the PC attached to a cmm.  if thats not an option you can use "tracefields" and operator inputs to populate a variable and group it the "collapse the group. that variable can be added to the PDF or excel report as well.

    L1 =LABEL/
    USER =COMMENT/INPUT,NO,FULL SCREEN=NO,
    Insert Operator Name:
    ASSIGN/USER1=USER.INPUT
    TRACEFIELD/DISPLAY=NO,REPORT=NO,DISPLAY MESSAGE=USER ; USER : USER1
    IF_GOTO/USER1==0,GOTO = L1

    or add a script

    assign the variable in pcdmis 1st

    ASSIGN/OPER=""

    Sub Main()
    Dim PCDApp, PCDPartPrograms, PCDPartProgram

    Set PCDApp = CreateObject("PCDLRN.Application")
    Set PCDPartPrograms = PCDApp.PartPrograms
    Set PCDPartProgram = PCDApp.ActivePartProgram
    Dim Cmds As Object
    Dim Cmd As Object
    Dim objFSO, objShell
    Dim objFile, objFolder As Object
    Dim SubPath As String
    Dim a,b As Integer
    Set Cmds = PCDPartProgram.Commands

    'operator Name
    user$ = InputBox$(" Operator Name:", "Insert Operator", "", 200, 175)

    For Each Cmd In Cmds
    If Cmd.Type = ASSIGNMENT Then
    If Cmd.GetText(DEST_EXPR, 0) = "OPER" Then
    bln = Cmd.PutText("""" + user$+ """", SRC_EXPR, 0)
    End If
    End If
    Next Cmd

    End If
    Next Cmd

    ' Cleanup
    Set PCDPartProgram = Nothing
    Set PCDPartPrograms = Nothing
    Set PCDApp = Nothing
    End Sub

    this will pass back the users input to the variable and you can report it or concatenate it into the name of the program as ran and set a "secret" location to auto save the .PRG for later review if needed

Children
No Data