[Me...] Posted July 14, 2020 Share Posted July 14, 2020 Hallo all, I hope everyone can help me. The situation. I have written a PCM-script to measure several tools with the same test plan. However, the calculation of the target values of a curve measurement is repeated for each tools with different parameters. By the way Israel Soto Rodriguez helped me with a script to calculate the target values. Thanks again ! For example: script tool 1 : in script 1 a for ... next loop for target calculation : script tool 2 : in script 2 the same for ... next loop for target calculation : script tool 3 : in script 3 a the same for ... next loop for target calculation : Is there a way to simplify it by creating the for ... next loop once, as a subroutine and only calling it in each script tool 1 ... 3 ? I hope you can understand my words. // Winfried Link to comment Share on other sites More sharing options...
[Is...] Posted July 14, 2020 Share Posted July 14, 2020 Maybe this: - Write only one loop using PCM variables. - Organize your variables in a text file with the extension: *.para (1 file / tool) - Then read the file (tool) you need in autorun. Other ways to read the parameters are: . Plan/ advanced/Parameter.. . readPCMFile(Filename) . runPCMFile(filename) Link to comment Share on other sites More sharing options...
[Er...] Posted July 14, 2020 Share Posted July 14, 2020 //define sub defineFunctionNamed("sub") A="what " B="ever" returnValue=A+B defineFunctionEnd("returnValue") //call sub executeFunctionNamed("sub") Return value of the function can be anything. A list, a matrix, an object, etc. How ever, reference object must be cleared from cache after usage. Or your program become corrupt after saving. Link to comment Share on other sites More sharing options...
[Me...] Posted July 15, 2020 Author Share Posted July 15, 2020 Good morning Eric, a problem, the function "defineFunctionNamed" does not worked on my PCM ?! Link to comment Share on other sites More sharing options...
[Da...] Posted July 15, 2020 Share Posted July 15, 2020 Please sign in to view this quote. You can find "defineFunctionStart" in the list. Link to comment Share on other sites More sharing options...
[Me...] Posted July 15, 2020 Author Share Posted July 15, 2020 Hello Dane, but Eric has written the function "defineFunctionNamed" ??? Link to comment Share on other sites More sharing options...
[Is...] Posted July 15, 2020 Share Posted July 15, 2020 Please sign in to view this quote. Maybe is a finger error (works OK with: defineFunctionStart): defineFunctionStart("sub") returnValue=A+B defineFunctionEnd("returnValue") //call sub A="what " B="ever" a=executeFunctionNamed("sub") A="hola " B="mundo" b=executeFunctionNamed("sub") Link to comment Share on other sites More sharing options...
[Er...] Posted July 15, 2020 Share Posted July 15, 2020 Yeah, my bad. Im on vacation and is postning from my Phone. So syntax error is more likely to occur. I should have mentiond that 🙂 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in