hexagon logo

Help with OLE Automation

Now that I have information in a way that imports and exports the information correctly, I have been tasked with creating an OLE to automatically import the data into the SPC software. I have one that sort of works (as in opens the program, logs in, opens the right collection plan, etc) and I can get put in static information, but I am unsure how to call the information out of PC DMIS to have it be placed in the spots we need in the SPC software being used.

Has anyone else done this? Can anyone explain to me how find the variable and the measurement output in PC DMIS? I am using version 4.2 if that helps any.

Thanks so much.
Parents
  • I have these two parts that are giving me a hard time with similar code, as follows:
    Set DmisCommand = DmisCommands.Add(DIMENSION_START_LOCATION, TRUE)
    DmisCommand.Marked = TRUE
    ' Set Id = PLANE4 Z
    retval = DmisCommand.PutText ("PLANE4 Z", ID, 0)
    ' Set Reference Id = PLANE4- TOP SURFACE OF BAFFLE
    retval = DmisCommand.PutText ("PLANE4- TOP SURFACE OF BAFFLE", REF_ID, 0)
    ' Set Graphic Analysis = OFF
    retval = DmisCommand.SetToggleString (1, GRAPH_ANALYSIS, 0)
    ' Set Textual Analysis = OFF
    retval = DmisCommand.SetToggleString (1, TEXT_ANALYSIS, 0)
    ' Set Arrow Multiplier = 10.000000
    retval = DmisCommand.PutText ("10.000000", ARROW_MULTIPLIER, 0)
    ' Set Output Type = BOTH
    retval = DmisCommand.SetToggleString (3, OUTPUT_TYPE, 0)
    ' Set Unit Type = IN
    retval = DmisCommand.SetToggleString (1, UNIT_TYPE, 0)
    ' Set Standard Deviation = 0.000083
    retval = DmisCommand.PutText ("0.000083", STANDARD_DEVIATION, 0)

    Set DmisCommand = DmisCommands.Add(DIMENSION_Z_LOCATION, TRUE)
    DmisCommand.Marked = TRUE
    ' Set Nominal = 0.5100
    retval = DmisCommand.PutText (" 0.5100", NOMINAL, 0)
    ' Set Measured = 0.5124
    retval = DmisCommand.PutText (" 0.5124", DIM_MEASURED, 0)
    ' Set Plus Tolerance = 0.0300
    retval = DmisCommand.PutText (" 0.0300", F_PLUS_TOL, 0)
    ' Set Minus Tolerance = 0.0300
    retval = DmisCommand.PutText (" 0.0300", F_MINUS_TOL, 0)
    ' Set Max = 0.5139
    retval = DmisCommand.PutText (" 0.5139", DIM_MAX, 0)
    ' Set Min = 0.5102
    retval = DmisCommand.PutText (" 0.5102", DIM_MIN, 0)
    ' Set Deviation = 0.0024
    retval = DmisCommand.PutText (" 0.0024", DIM_DEVIATION, 0)
    ' Set Out Tol = 0.0000
    retval = DmisCommand.PutText (" 0.0000", DIM_OUTTOL, 0)

    Set DmisCommand = DmisCommands.Add(DIMENSION_END_LOCATION, TRUE)
    DmisCommand.Marked = TRUE

    I currently have it in the program as: If StrDimID = "PLANE4 Z" Then MyReading12 = MeasZ but it returns a value that is half of what is expected.

    I looked for the dimension_z_location command in the forum and I found this thread: http://www.pcdmisforum.com/showthread.php?3751-Accessing-FCF-True-Position-in-VB&highlight=dimension_z_location and part of me thinks that there is something in there that may help but not sure if that is exactly what I looking for. Any thoughts?
Reply
  • I have these two parts that are giving me a hard time with similar code, as follows:
    Set DmisCommand = DmisCommands.Add(DIMENSION_START_LOCATION, TRUE)
    DmisCommand.Marked = TRUE
    ' Set Id = PLANE4 Z
    retval = DmisCommand.PutText ("PLANE4 Z", ID, 0)
    ' Set Reference Id = PLANE4- TOP SURFACE OF BAFFLE
    retval = DmisCommand.PutText ("PLANE4- TOP SURFACE OF BAFFLE", REF_ID, 0)
    ' Set Graphic Analysis = OFF
    retval = DmisCommand.SetToggleString (1, GRAPH_ANALYSIS, 0)
    ' Set Textual Analysis = OFF
    retval = DmisCommand.SetToggleString (1, TEXT_ANALYSIS, 0)
    ' Set Arrow Multiplier = 10.000000
    retval = DmisCommand.PutText ("10.000000", ARROW_MULTIPLIER, 0)
    ' Set Output Type = BOTH
    retval = DmisCommand.SetToggleString (3, OUTPUT_TYPE, 0)
    ' Set Unit Type = IN
    retval = DmisCommand.SetToggleString (1, UNIT_TYPE, 0)
    ' Set Standard Deviation = 0.000083
    retval = DmisCommand.PutText ("0.000083", STANDARD_DEVIATION, 0)

    Set DmisCommand = DmisCommands.Add(DIMENSION_Z_LOCATION, TRUE)
    DmisCommand.Marked = TRUE
    ' Set Nominal = 0.5100
    retval = DmisCommand.PutText (" 0.5100", NOMINAL, 0)
    ' Set Measured = 0.5124
    retval = DmisCommand.PutText (" 0.5124", DIM_MEASURED, 0)
    ' Set Plus Tolerance = 0.0300
    retval = DmisCommand.PutText (" 0.0300", F_PLUS_TOL, 0)
    ' Set Minus Tolerance = 0.0300
    retval = DmisCommand.PutText (" 0.0300", F_MINUS_TOL, 0)
    ' Set Max = 0.5139
    retval = DmisCommand.PutText (" 0.5139", DIM_MAX, 0)
    ' Set Min = 0.5102
    retval = DmisCommand.PutText (" 0.5102", DIM_MIN, 0)
    ' Set Deviation = 0.0024
    retval = DmisCommand.PutText (" 0.0024", DIM_DEVIATION, 0)
    ' Set Out Tol = 0.0000
    retval = DmisCommand.PutText (" 0.0000", DIM_OUTTOL, 0)

    Set DmisCommand = DmisCommands.Add(DIMENSION_END_LOCATION, TRUE)
    DmisCommand.Marked = TRUE

    I currently have it in the program as: If StrDimID = "PLANE4 Z" Then MyReading12 = MeasZ but it returns a value that is half of what is expected.

    I looked for the dimension_z_location command in the forum and I found this thread: http://www.pcdmisforum.com/showthread.php?3751-Accessing-FCF-True-Position-in-VB&highlight=dimension_z_location and part of me thinks that there is something in there that may help but not sure if that is exactly what I looking for. Any thoughts?
Children
No Data