hexagon logo

Why is that get only one measurement data after the script execution?

why is that get only one measurement data after the script execution ??

code:

Sub Main()
Dim App As Object
Set App = CreateObject("PCDLRN.Application")
Dim Part As Object
Set Part = App.ActivePartProgram
Part.AsyncExecute
End Sub
  • How many did you expect?

    How many results do you have in your program?
  • How many did you expect?

    How many results do you have in your program?


    PC - DMIS run several times in the report there are several data results, but in fact only one result at this time
  • so this is supposed to run a part program asynchronously? if you are using this in a loop then you are going to tell pc-dmis to run a part program and before that part program completes you will run it again, this (in theory) should cause pc-dmis to execute in offline mode for each successive run, until the first one completes. Maybe this is the issue.


    Maybe you should try
    Part.Execute
    


    this will run the part program until it completes, then run the part program again.

    but then again i could be way wrong, could you give us more info on what you are trying to accomplish...
  • There are two report modes, one icon in the reporting toolbar displays the "current run", which would display one execution of the program.
    The other icon displays the total, complete report - if you had several executions, they should display when you are clicking this icon.
  • There are two report modes, one icon in the reporting toolbar displays the "current run", which would display one execution of the program.
    The other icon displays the total, complete report - if you had several executions, they should display when you are clicking this icon.


    try this......
    Sub Main
    Dim App As Object
    Set App = CreateObject("PCDLRN.Application")
    Dim Part As Object
    Set Part = App.ActivePartProgram
    Dim Cmds As Object
    Set Cmds = Part.Commands
    Dim Cmd As Object
    Dim Seb
    For i=1 To cmds.count
    Set cmd=cmds.item(i)
    If cmd.gettext(MODE_TYPE,0)="DCC" Then Exit For
    Next
    For j=1 To 3
    Seb=Part.SetExecutionBlock(cmds.item(i),cmds.item(cmds.count))
    Part.AsyncExecute
    Next
    End Sub