再:圧力補償温度式のためのJSLの助けが必要- JMPのインストール時にダウンロードしたJMPドキュメントライブラリのスクリプティングガイドを読む
- UIについて少しお手伝いしますが、「 複数のIFステートメントとUIデータを使用した数式を使用して、各行の圧力補償温度を計算します。 "は漠然としていて、実際にあなたを導くことはできません。

上記のJSLは次のとおりです。 ウィンドウから情報を取得して、数式にプラグインするだけです。 ドキュメントのColumn Dialog()およびNew Column()に関するセクションを読む
names default to here(1);
dtList = New Table("Example Data",
new column("Temperature"),
new column("Pressure")
);
dlg = Column Dialog(
temperatureCol = ColList( "Temperature", Min Col( 1 ), Max Col( 2 ), Data Type( "Numeric" ) ),
pressureCol = ColList( "Pressure", Max Col( 1 ), Modeling Type( {"Continuous", "Multiple Response"} ) ),
Line Up( 2,
Text Box( "Reference Pressure" ), refPressure = EditNumber( . ),
Text Box( "Conversion Factor" ), conFactor = EditNumber( . ),
Text Box( "Purity Factor" ), purFactor = EditNumber( . )
));
show(dlg);再:圧力補償温度式のためのJSLの助けが必要涼しい!列ダイアログを使用したことがあるかどうかはわかりませんが、この作業には最適のようです。
Jimの例を実行したら、次のようなコードを試して、数式列をテーブルに追加します。
Eval( // run the code below
Eval Expr( // convert the Expr(...) below into a hard coded value
// eval(evalexpr(expr(...))) is a pattern for getting values from the dlg INTO
// A FORMULA. if you follow this pattern, the formula will be self contained.
dtList << New Column( "adjusted",
formula( // random formula that uses all the variables AND shows an if() stmt
If( Expr( dlg["refPressure"] ) > Expr( dlg["pressureCol"][1] ),
Expr( dlg["temperatureCol"][1] ) + // first item of list
Expr( dlg["pressureCol"][1] ) + //
Expr( dlg["conFactor"] ) + // simple value
Expr( dlg["purFactor"] ) + //
Expr( dlg["refPressure"] )// do the ususal stuff...
, // else refPressure <= pressureCol...
Expr( dlg["temperatureCol"][1] ) + // first item of list
Expr( dlg["pressureCol"][1] ) + //
Expr( dlg["conFactor"] ) + // simple value
Expr( dlg["purFactor"] ) + //
Sqrt( Expr( dlg["refPressure"] ) )// do something extra for low ref
)
)
)
)
);ここでいくつかのことが起こっています。
- formula()は引数を評価しないため、いくつかの助けを与える必要があります
- 私はeval(evalexpr(expr(...)))テクニックに頼っています。他の方法があります。
- あなたはif(...)が必要だと言ったので、私はそれを作りました。結果に対して単純な数値を生成する任意のJSLを使用できます。if()の結果は、それが計算する最後の値です。
- 数式で変数を2回以上使用する必要がある場合は、上記の数式を確認してください。
- 明らかに私の処方はあなたが探しているものではありません!
- 単純な数式の場合、evalexprのすべてが必要なわけではありません。式(:圧力*:温度)は正常に動作します。しかし、この例では、列の名前がわかりません。代わりに、列の名前を保持する変数の名前を知っています。
参考までに、dlgは次のリストを返します。
// this is what the dlg returns; the columns are a list of 1 item
// and the parameters are simple values:
//
// {temperatureCol = {:Temperature}, pressureCol = {:Pressure},
// Text Box, refPressure = 3, Text Box, conFactor = 33,
// Text Box, purFactor = 333, Button( 1 )}最後に、数式エディタを使用して作成した数式を確認し、それが本当に期待どおりであることを確認してください。
Click the + next to the column name to open the formula in the editorClick the + next to the column name to open the formula in the editor列名の横にある+をクリックして、エディターで式を開きます
再:圧力補償温度式のためのJSLの助けが必要こんにちは、
どういう意味 " 圧力補償温度」?より具体的な詳細は、サポートが容易になります
再:圧力補償温度式のためのJSLの助けが必要 @txnelson あずきっく
どうもありがとうございました!これはまさに私が必要としたものです。 これは最適ではないかもしれませんが、圧力補償温度(pct)を導出するための式を使用して中間カラムを作成することになりました。 データテーブルにいくつかの中間列が必要ないため、式をpctから削除して中間列を削除しました。 データ行を追加する場合は、スクリプトを再実行する必要があります。
以下に思いついたコードを貼り付けました(ただし、自分の作業のため、すべての定数/係数を変更する必要がありました)
//Script for creating a pressure compensated temperature tag
//Rev 1 8/25/20
names default to here(1);
/*dtList = New Table("Example Data",
new column("Temperature"),
new column("Pressure")
);*/
dtList = CurrentDataTable();
dlg = Column Dialog(
temperatureCol = ColList( "Temperature", Max Col( 1 ), Modeling Type( {"Continuous", "Multiple Response"} ) ),
pressureCol = ColList( "Pressure", Max Col( 1 ), Modeling Type( {"Continuous", "Multiple Response"} ) ),
Line Up( 2,
Text Box( "Reference Pressure" ), refPressure = EditNumber( . ),
Text Box( "Conversion Factor" ), conFactor = EditNumber( 1 ),
Text Box( "Purity Factor" ), purFactor = EditNumber( 1 ),
Text Box( "Pressure Units"), unitsP = comboBox( {"Gauge","Absolute"}),
Text Box( "PComp Tag Name"), pcompTag = EditText( "PComp Tag" )
),
Text Box("
**Reference Pressure is the base pressure and must be in the same units as the pressure tag.
**Pressure Units is a logical to indicate if the pressure being measured is absolute or gauge. For most
situations, the pressure will be measure in terms of gauge. However, vacuum pipestills typically use absolute.
**PComp Tag Name will be the column name of the new Pressure Compensate Temperature tag.
"),
);
show(dlg);
//Absolute needs to be 0 and Gauge needs to be 1. The combo box has Absolute as 2 and Gauge as 1,
If( dlg["unitsP"] == 1, dlg["unitsP"] = 1, dlg["unitsP"] = 0 );
//Write("unitsP equals: ", dlg["unitsP"]);
Eval( // run the code below
Eval Expr( // convert the Expr(...) below into a hard coded value
// eval(evalexpr(expr(...))) is a pattern for getting values from the dlg INTO
// A FORMULA. if you follow this pattern, the formula will be self contained.
dtList << New Column( "PA",
formula( // random formula that uses all the variables AND shows an if() stmt
Expr( dlg["purFactor"] ) *
(Expr( dlg["unitsP"] ) + Expr( dlg["pressureCol"][1] ) * Expr( dlg["purFactor"] ) / 12)
)
)
)
);
Eval( // run the code below
Eval Expr(
dtList << New Column( "PB",
formula( // random formula that uses all the variables AND shows an if() stmt
Expr( dlg["refPressure"] ) * Expr( dlg["conFactor"] ) / 12 + Expr( dlg["unitsP"] )
)
)
)
);
Eval(
Eval Expr(
dtList << New Column( "TA",
formula( // random formula that uses all the variables AND shows an if() stmt
Expr( dlg["temperatureCol"][1] ) + 400
)
)
)
);
New Column( "AA",
formula(
If( :PA >= 1.1111 ,
(4 - LOG10(:PA)) / (2000 - 25*LOG10(:PA)) - 0.0001
, // else
(3- LOG10(:PA)) / (2000 - 25*LOG10(:PA)) - 0.0001
)
)
);
New Column( "AB",
formula(
If( :PB >= 1.1111 ,
(4 - LOG10(:PB)) / (2000 - 25*LOG10(:PB)) - 0.0001
, // else
(3 - LOG10(:PB)) / (2000 - 100*LOG10(:PB)) - 0.0001
)
)
);
New Column( "DEN",
formula(
:AB / :AA * ((1.1 / :TA) - 0.0001) + 0.0001
)
);
New Column( "TB",
formula(
1.1 / :DEN - 400
)
);
Column("TB") << delete formula;
Column("TB") << Set Name( dlg["pcompTag"] );
dtList << delete columns( {"PA","PB","TA","AA","AB","DEN"} );圧力補償された温度式については JSL に関するヘルプが必要ですこんにちは、
次の圧力補償温度の JSL の作成を開始する方法に関する例またはガイダンスを探しています。
- 温度列と圧力列を選択するための UI を作成します。また、ユーザーに基準圧力、変換係数、純度係数を入力してもらいます。
- UI データを使用して、いくつかの IF ステートメントと数式を使用して、各行の圧力補償温度を計算します。
- 新しい列を作成し、上で計算した圧力補償温度を入力します。
助けていただければ幸いです。
品質およびプロセスエンジニアリング