hexagon logo

PDLRN - How to get the number of parts from multipart program

In a program which is set up to measure multiple parts, how can I get the part count from PCDMIS? Is it a matter of getting the loop count or is there a more sophisticated way? I'm using vb.net.

Thanks
  • Are you looking to get the # of parts after the execution is complete? If that is the case, I think the loop count is the best way.

    If you are looking for the current part count during execution, you can set up a variable to be displayed with the COMMENT/READOUT option, which would put it below the XYZ counters in the readout window while the program is running.
  • Thanks for the reply Don. I actually figured out each of the dimension commands holds a value for each part it measured, the number of which can be obtained using
    cmd.count
    where cmd is a
    PCDLRN.Command
    . This way was the most practical solution for me given what I was trying to achieve in my code. For whatever reason it took me an age to figure out it was as simple as that!
  • You should have a variable value for the loop counter, which you should be able to retrieve with GetVariableValue.
  • You should have a variable value for the loop counter, which you should be able to retrieve with GetVariableValue.

    Thanks for the reply. Thats another good solution but I would assume that if for some reason the program failed on one of the parts for example that the loop counter might exceed the count of the command values.