如何使用 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
)
);
)
);