안녕하세요, 두 개의 파일(Limits와 wat_combined)이 있습니다. Limit 파일에는 wat_combined 파일에 동일한 테스트에 설정하려는 제한이 있습니다. 제 JSL 스크립트는 예상대로 작동하지만, 사양이 열의 영역을 제한합니다. 이 문제를 해결하는 방법을 알려주세요.
Jmp 버전: 18.2.0
txnelson 참고: @프라나딥 초기 메시지를 편집하여 JSL을 JSL 상자로, 로그를 코드 상자로 이동했습니다.
내 jsl 코드:
// --- Configuration ---
limitsFilePath = "C:\\Users\\saipranadeep\\Desktop\\JMP_Data\\script check\\Limits.jmp";
dataFilePath = "C:\\Users\\saipranadeep\\Desktop\\JMP_Data\\script check\\wat_combined.jmp";
// --- Script ---
Print("--- Script Start ---");
Print("Attempting to close any existing tables...");
Try( Close( Data Table( "Limits" ), NoSave ) );
Try( Close( Data Table( "wat_combined" ), NoSave ) );
Print("Existing tables closed (if any).");
Print("Opening Limits file: " || limitsFilePath);
dtLimits = Open( limitsFilePath );
Print("Opening Data file: " || dataFilePath);
dtData = Open( dataFilePath );
Print("Checking if tables opened successfully...");
If( Is Empty( dtLimits ), Throw( "Failed to open Limits JMP file: " || limitsFilePath ) );
If( Is Empty( dtData ), Throw( "Failed to open wat_combined JMP file: " || dataFilePath ) );
Print("Limits table opened successfully: " || Char(!Is Empty( dtLimits )) || " (1=Yes, 0=No)");
Print("Data table opened successfully: " || Char(!Is Empty( dtData )) || " (1=Yes, 0=No)");
colName_Test = "Test"; // From Limits file
colName_USL = "USL"; // From Limits file
colName_LSL = "LSL"; // From Limits file
Print("Column names defined: Test='" || colName_Test || "', USL='" || colName_USL || "', LSL='" || colName_LSL || "'");
// --- Ensure 'Test' column is Character type ---
Column( dtLimits, colName_Test ) << Set Data Type( Character );
// --- Create limit maps ---
lslMap = Associative Array();
uslMap = Associative Array();
rowCountLimits = N Row( dtLimits );
Print("Associative maps 'lslMap' and 'uslMap' created.");
// Populate limit maps with valid data from the Limits table
Print( "--- Start Populating Limit Maps (" || Char(rowCountLimits) || " rows total) ---" );
For( i = 1, i <= rowCountLimits, i++,
testNameKey_val = Column( dtLimits, colName_Test )[i];
usl_val = Column( dtLimits, colName_USL )[i];
lsl_val = Column( dtLimits, colName_LSL )[i];
If( Is Missing( usl_val ) | Is Missing( lsl_val ) | Is Missing( testNameKey_val ) | testNameKey_val == "",
Print( "Skipping Row " || Char(i) || " (Missing Data)" );
Next();
);
testNameKey = Char( testNameKey_val ); // Convert to string
lsl_num = Num( lsl_val );
usl_num = Num( usl_val );
If( Is Missing( lsl_num ) | Is Missing( usl_num ),
Print( "Skipping Row " || Char(i) || " (Invalid Numeric Conversion)" );
Next();
);
// Add to maps if valid
lslMap[testNameKey] = lsl_num;
uslMap[testNameKey] = usl_num;
Print( "Added LSL=" || Char(lsl_num) || ", USL=" || Char(usl_num) || " for test '" || testNameKey || "' to maps" );
);
Print( "--- Finished Populating Limit Maps ---" );
// --- Applying Spec Limits ---
Print("--- Applying Spec Limits to Columns ---");
dataCols = dtData << Get Column Names( String );
limitTestNames = lslMap << Get Keys;
appliedCount = 0;
For( i = 1, i <= N Items( dataCols ), i++,
dataColName = dataCols[i];
longestMatchName = ""; // Track the best matching test name
matchFound = 0; // Flag to check if any match is found
For( j = 1, j <= N Items( limitTestNames ), j++,
limitTestName = limitTestNames[j];
If( Contains( Lowercase( Trim( dataColName ) ), Lowercase( Trim( limitTestName ) ) ),
longestMatchName = limitTestName;
matchFound = 1;
);
);
If( matchFound,
lsl = lslMap[longestMatchName];
usl = uslMap[longestMatchName];
If( Is Number(lsl) & Is Number(usl),
// Apply Spec Limits and ensure Graph Reference Lines are shown
Column( dtData, dataColName ) << Set Property(
"Spec Limits",
{LSL( lsl ), USL( usl ), Show Limits( 1 )}
);
appliedCount++;
Print( "Applied limits from [" || longestMatchName || "] to column: [" || dataColName || "] (LSL=" || Char( lsl ) || ", USL=" || Char( usl ) || ")" );
);
);
);
Print( "Applied limits to " || Char(appliedCount) || " columns." );
// --- Save Data Table ---
dtData << Save( "$DESKTOP/JMP_Data/script check/wat_combined_with_limits.jmp" ); // Save table with changes
// --- Final Check ---
Print("Spec limits should now be applied to columns.");
Print("--- Script End ---");
통나무:
"--- Script Start ---"
"Attempting to close any existing tables..."
"Existing tables closed (if any)."
"Opening Limits file: C:\\Users\\saipranadeep\\Desktop\\JMP_Data\\script check\\Limits.jmp"
"Opening Data file: C:\\Users\\saipranadeep\\Desktop\\JMP_Data\\script check\\wat_combined.jmp"
"Checking if tables opened successfully..."
"Limits table opened successfully: 1 (1=Yes, 0=No)"
"Data table opened successfully: 1 (1=Yes, 0=No)"
"Column names defined: Test='Test', USL='USL', LSL='LSL'"
"Associative maps 'lslMap' and 'uslMap' created."
"--- Start Populating Limit Maps (4 rows total) ---"
"Added LSL=25, USL=83 for test 'Vtl_P3uL' to maps"
"Added LSL=30, USL=88 for test 'Vtl_P3S' to maps"
"Added LSL=30, USL=36 for test 'Vtl_P3L' to maps"
"Added LSL=26, USL=32 for test 'Vtl_P3eL' to maps"
"--- Finished Populating Limit Maps ---"
"--- Applying Spec Limits to Columns ---"
"Applied limits from [Vtl_P3uL] to column: [Vtl_P3uL] (LSL=25, USL=83)"
"Applied limits from [Vtl_P3S] to column: [Vtl_P3S] (LSL=30, USL=88)"
"Applied limits from [Vtl_P3L] to column: [Vtl_P3L] (LSL=30, USL=36)"
"Applied limits from [Vtl_P3eL] to column: [Vtl_P3eL] (LSL=26, USL=32)"
"Applied limits to 4 columns."
"Spec limits should now be applied to columns."
"--- Script End ---"
문제:
안녕하세요, 두 개의 파일(Limits와 wat_combined)이 있습니다. Limit 파일에는 wat_combined(column) 파일에 동일한 테스트에 설정하려는 제한이 있습니다. 제 JSL 스크립트는 예상대로 작동하지만 열의 사양 제한 영역이 추가되지 않습니다. 해결 방법을 알려주세요.

JSL을 간단히 살펴본 결과, 문제가 될 수 있는 항목이 2개 확인되었습니다.
- Next()라는 함수는 잘 모르겠습니다. 코드에서 몇 번 사용하셨는데, 아마도 Break() 함수를 사용하시려는 것 같습니다.
- Around line 110 you are attempting to set the Spec Limits column property. In it you reference the memory variables of usl and lsl. The issue is that the references are within a JMP list {}. JMP lists are not evaluated prior to execution. Therefore, usl and lsl will not be evaluated. The easiest way to get the values evaluated is to use Eval( Evalexpr ())
Eval(
Eval Expr(
Column( dtData, dataColName ) << Set Property(
"Spec Limits",
{LSL( Expr( lsl ) ), USL( Expr( usl ) ), Show Limits( 1 )}
)
)
);
This will force the evaluation prior to actually executing the Set Property
안녕,
스크립팅 문제가 발생하거나 바로 사용할 수 있는 솔루션을 선호하는 경우 JSL을 작성하지 않고 사양 제한을 처리하고 수율 분석을 수행하는 방법을 보여주는 JMP 추가 기능이 포함된 짧은 튜토리얼이 있습니다.
https://www.youtube.com/watch?v=Nx5jWKAl7Z0
YieldOptiX는 테스트 데이터 워크플로우를 위해 설계되었으며 JMP의 사양 제한 관리 기능을 활용하여 사전 정의된 제약 조건 내 또는 그 너머의 분포 매개변수를 기반으로 최적의 제한을 자동으로 찾는 기능을 추가합니다.
좀 더 간소화된 접근 방식을 원하신다면 도움이 될 수도 있습니다.