如何使用 JSL 取得 IR 控製圖中的限值你好,
假設我有一個保存了多個參數列的限製表,如下所示。 有沒有辦法讀取此文件並使用 JSL 將限制應用於 IR 圖表以獲取匹配參數?

根據以下帖子,無法使用 JSL 從「控製圖」對話方塊中呼叫「取得限制」功能。 在這種情況下,建議對限制進行硬編碼。
如何取得 IR 控製圖的能力限制
我想我需要讀取限製文件,捕獲 Sigma、Avg、LCL 和 UCL 作為變量,然後將它們傳遞給每個參數的圖表 Col。如果這是唯一的方法,那麼最有效的方法是什麼?
請參閱下面的程式碼範例,以了解具有硬編碼的相位等級和限制的單一控製圖參數:
Control Chart(
Sample Label( :WEEK ),
Phase( :YEAR ),
Group Size( 1 ),
KSigma( 3 ),
Chart Col(
:P1,
Individual Measurement(
Test 1( 1 ),
Test 2( 1 ),
Test 5( 1 ),
Test 6( 1 ),
Phase Level(
"2019",
Sigma( 0.0106958422036977 ),
Avg( 5.59766666666667 ),
LCL( 5.56557914005557 ),
UCL( 5.62975419327776 )
)
)
)
);
先感謝您。
瑞
回覆:如何使用 JSL 取得 IR 控製圖中的限制出色的! 這讓我走上了正軌。
謝謝你!
回覆:如何使用 JSL 取得 IR 控製圖中的限制您可以將 JSL 與「取得限制」命令結合使用以取得 IR 控製圖。您引用的帖子是關於規格限值而不是控制限。如果您有控制限制,則可以將下列 JSL 與 Get Limits 指令結合使用。
dt = Open("$SAMPLE_DATA/Quality Control/Coating.jmp");
obj = Control Chart(
Sample Size( Column(dt, "Sample") ),
Chart Col( :Weight, XBar, R ),
Get Limits(
"$SAMPLE_DATA/Quality Control/CoatingLimits.jmp"
)
);
回覆:如何使用 JSL 取得 IR 控製圖中的限制
Not Found in access or evaluation of 'Control Chart' , Bad Argument( {:Month Alerted, :YEAR} ), Control Chart(/*###*/Sample Label( :Month Alerted ),
Phase( :YEAR ),
Group Size( 1 ),
KSigma( 3 ),
Chart Col(
:Grand Total,
Individual Measurement(
Test 1( 1 ),
Test 2( 1 ),
Test 5( 1 ),
Test 6( 1 ),
Phase Level(
"2019",
Sigma( 9843.52246062887 ),
Avg( 54802.5935983333 ),
LCL( 25272.0262164467 ),
UCL( 84333.1609802199 )
)
)
)
)
我的專欄是“每月提醒”,列資料內容是 12 個月,採用這種格式 2019-04,因此我將範例標籤更改為:“每月提醒”。
下一部分是年份和階段,它與我的數據不匹配,所以我認為這就是它不起作用的地方?
限制是多列,但每列都有不同的標題,理想情況下我不想寫每個列標題。
我還需要大小(500,175),但不確定它適合程式碼中的位置並保存到資料表中。
我確實嘗試使用控製圖生成器,但無法添加限制。 我選擇了該文件,但之後什麼也沒做。 這意味著我無法獲得某種腳本。
非常感謝 - 我已附上腳本
回覆:如何使用 JSL 取得 IR 控製圖中的限制您在日誌中收到什麼錯誤訊息?回覆:如何使用 JSL 取得 IR 控製圖中的限制您好,我遇到了這個解決方案並嘗試實現它,但它對我不起作用,它會打開我在腳本頂部指定的文件,但不會繼續執行腳本的其餘部分。 這可能與階段部分有關,但我不完全明白它來自哪裡? 感謝您的協助回覆:如何使用 JSL 取得 IR 控製圖中的限制感謝吉姆的快速回覆。我試圖設定控制限和西格瑪屬性,但收到錯誤:
too many arguments in access or evaluation of 'Expr' , Expr/*###*/(Column( finalDt, colNamesList[i] ) <<
Set Property(
"Control Limits",
{Individual Measurement( Avg( __avg__ ), LCL( __LCL__ ), UCL( __UCL__ ) )}
), Column( finalDt, colNamesList[i] ) << Set Property( "Sigma", __sigma__ ))問題是我試圖在同一個替換表達式中定義兩個不同的列屬性。將其分解為 2 個 Eval 後,它就可以工作了。見下文。
Current Data Table( finalDt );
Wait(0);
// Get list of columns to chart
colNameList = finalDt << get column names( continuous, string );
// Loop across all of the columns and create the charts
For( i = 2, i <= N Items( colNameList ), i++,
// If limits exist for the current column, then process
If( Try( Column( dtLimits, colNameList[i] ) << get name ) != "",
// get the limits needed
// sigma
theSigma = Column( dtLimits, colNameList[i] )[(dtLimits << get rows where( :_LimitsKey == "_Std Dev" ))[1]];
theAvg = Column( dtLimits, colNameList[i] )[(dtLimits << get rows where( :_LimitsKey == "_Mean" ))[1]];
theLCL = Column( dtLimits, colNameList[i] )[(dtLimits << get rows where( :_LimitsKey == "_LCL" ))[1]];
theUCL = Column( dtLimits, colNameList[i] )[(dtLimits << get rows where( :_LimitsKey == "_UCL" ))[1]];
Eval(
Substitute(
Expr( __process__ << Set Property("Control Limits", {Individual Measurement( Avg( __avg__ ), LCL( __LCL__ ), UCL( __UCL__ ))})),
Expr( __process__ ), Parse( ":" || colNameList[i] ),
Expr( __avg__ ), theAvg,
Expr( __LCL__ ), theLCL,
Expr( __UCL__ ), theUCL
)
);
Eval(
Substitute(
Expr( __process__ << Set Property("Sigma", __sigma__)),
Expr( __process__ ), Parse( ":" || colNameList[i] ),
Expr( __sigma__ ), theSigma,
)
);
)
);再次感謝您的快速幫助。
瑞
回覆:如何使用 JSL 取得 IR 控製圖中的限制如果您以互動方式設定 IR 圖表的控制限值,然後使用下列 JSL 擷取限值,
:columnname <<GET property=""></GET>
將顯示為列屬性儲存的結構
{Individual Measurement(
Avg( 62.55 ),
LCL( 51.574420384821 ),
UCL( 73.525579615179 )
)}
因此,所要做的就是從限制資料表中讀取訊息,然後建立上述結構並將其傳遞到測量資料表列。下面是我之前的腳本的修改,不同之處在於它填充了控制限,而不是運行控製圖
Names Default To Here( 1 );
dt = Open( "path to data table" );
dtLimits = Open( "path to limits table" );
// Get list of columns to chart
colNameList = dt << get column names( continuous, string );
// Loop across all of the columns and create the charts
For( i = 1, i <= N Items( colNameList ), i++,
// If limits exist for the current column, then process
If( Try( Column( dtLimits, colNameList[i] ) << get name ) != "",
// get the limits needed
theAvg = Column( dtLimits, colNameList[i] )[(dtLimits << get rows where( _LimitsKey == "_Mean" ))[1]];
theLCL = Column( dtLimits, colNameList[i] )[(dtLimits << get rows where( _LimitsKey == "_LCL" ))[1]];
theUCL = Column( dtLimits, colNameList[i] )[(dtLimits << get rows where( _LimitsKey == "_UCL" ))[1]];
Eval(
Substitute(
Expr(
__Process__ << set property(
"Control Limits",
{Individual Measurement( Avg( __avg__ ), LCL( __LCL__ ), UCL( __UCL__ ) )}
)
),
Expr( __process__ ), Parse( ":" || colNameList[i] ),
Expr( __avg__ ), theAvg,
Expr( __LCL__ ), theLCL,
Expr( __UCL__ ), theUCL
)
);
)
);回覆:如何使用 JSL 取得 IR 控製圖中的限制嗨吉姆,
您能告訴我如何使用您提到的第一種方法嗎? 從限製表中讀取限制,然後將它們套用為列屬性。
謝謝你,
瑞
回覆:如何使用 JSL 取得 IR 控製圖中的限制謝謝吉姆。 我必須對 Get RowsWhere(_LimitsKey == ...) 部分進行小編輯。 只需添加冒號“:”,使其變為 Get RowsWhere( :_LimitsKey == ...) 然後一切正常。 不過有一個問題。 此腳本為每個參數控製圖產生單獨的視窗。 有沒有一種方法可以產生一個窗口,其中每個參數的控製圖堆疊在一起(就像我在“紅外線控制圖”對話框中選擇了多個參數一樣)?回覆:如何使用 JSL 取得 IR 控製圖中的限制有兩種基本方法可以做到這一點。
- 從限製表中讀取數據,然後將限制儲存為「列屬性」。 然後運行所需的圖表。
- 循環遍歷要繪製圖表的列,從限製表中讀取限制並將其插入到 JSL 中以產生圖表。
這是我在下面的腳本中使用的第二種方法。它應該是一個工作腳本,但如果沒有實際的限製表和實際的資料表,可能會出現一些故障。
Names Default To Here( 1 );
dt = Open( "path to data table" );
dtLimits = Open( "path to limits table" );
// Get list of columns to chart
colNameList = dt << get column names( continuous, string );
// Loop across all of the columns and create the charts
For( i = 1, i <= N Items( colNameList ), i++,
// If limits exist for the current column, then process
If( Try( Column( dtLimits, colNameList[i] ) << get name ) != "",
// get the limits needed
// sigma
theSigma = Column( dtLimits, colNameList[i] )[(dtLimits <<
get rows where( _LimitsKey == "_Std Dev" ))[1]];
theAvg = Column( dtLimits, colNameList[i] )[(dtLimits <<
get rows where( _LimitsKey == "_Mean" ))[1]];
theLCL = Column( dtLimits, colNameList[i] )[(dtLimits <<
get rows where( _LimitsKey == "_LCL" ))[1]];
theUCL = Column( dtLimits, colNameList[i] )[(dtLimits <<
get rows where( _LimitsKey == "_UCL" ))[1]];
Eval(
Substitute(
Expr(
Control Chart(
Sample Label( :WEEK ),
Phase( :YEAR ),
Group Size( 1 ),
KSigma( 3 ),
Chart Col(
__process__,
Individual Measurement(
Test 1( 1 ),
Test 2( 1 ),
Test 5( 1 ),
Test 6( 1 ),
Phase Level(
"2019",
Sigma( __sigma__ ),
Avg( __avg__ ),
LCL( __LCL__ ),
UCL( __UCL__ )
)
)
)
)
),
Expr( __process__ ), Parse( ":" || colNameList[i] ),
Expr( __sigma__ ), theSigma,
Expr( __avg__ ), theAvg,
Expr( __LCL__ ), theLCL,
Expr( __UCL__ ), theUCL
)
);
)
);