Jump to content

PCM for several tools


---
 Share

Recommended Posts

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

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)

1375_239e4ebaab4436c62e666208afbb1be0.png
1375_71aee76c7b6a29e47e629b437de48317.png
Link to comment
Share on other sites

//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

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

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

 Share

×
×
  • Create New...