Re : 압력 보상 온도 공식에 대한 JSL의 도움이 필요하십니까- JMP를 설치할 때 다운로드 한 JMP 문서 라이브러리에서 스크립팅 가이드 읽기
- UI에 대해 조금 도와 드릴 수는 있지만 " UI 데이터를 사용하여 여러 IF 문과 수학 식을 사용하여 각 행에 대한 압력 보상 온도를 계산합니다. "너무 모호해서 안내 할 수 없습니다.

위의 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);Re : 압력 보상 온도 공식에 대한 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 ()의 결과는 계산하는 마지막 값입니다.
- 수식에서 변수를 두 번 이상 사용해야하는 경우 위의 수식을 참조하십시오.
- 분명히 내 공식은 당신이 찾고있는 것이 아닙니다!
- 간단한 공식의 경우 모든 evalexpr 항목이 필요하지 않습니다. formula (: pressure * : temperature)가 잘 작동합니다. 그러나이 예에서는 열의 이름을 알지 못합니다. 대신 열 이름을 보유하는 변수의 이름을 알고 있습니다.
참고로 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열 이름 옆에있는 +를 클릭하여 편집기에서 수식을 엽니 다.
Re : 압력 보상 온도 공식에 대한 JSL의 도움이 필요하십니까안녕하세요,
"이 무슨 뜻이야? 압력 보상 온도 "?보다 구체적인 세부 정보가 지원을 받기 더 쉬울 것입니다.
Re : 압력 보상 온도 공식에 대한 JSL의 도움이 필요하십니까 헉헉 안녕하세요.
둘 다 대단히 감사합니다! 이것이 바로 내가 필요한 것입니다. 이것은 최적이 아닐 수도 있지만 압력 보상 온도 (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 문과 수학적 표현식을 사용하여 각 행의 압력 보상 온도를 계산합니다.
- 새 열을 만들고 위에서 계산한 압력 보상 온도를 입력합니다.
도움을 주시면 감사하겠습니다!
품질 및 프로세스 엔지니어링