Subscribe Bookmark RSS Feed

Alarm Script output to a Table?

I've been working with Alarm Scripts and getting the results in the log just fine, my question is how would I get that output into a data table (static or dynamically created in script).
3 REPLIES
mpb

Super User

Joined:

Jun 23, 2011

Here's an example of one way to do it in version 8.




style="font-size: 10pt; font-family: "Courier New"; color: black;">dt

style="font-size: 10pt; font-family: "Courier New"; color: navy;">=

style="font-size: 10pt; font-family: "Courier New"; color: black;">

style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">Open

style="font-size: 10pt; font-family: "Courier New"; color: black;">(

style="font-size: 10pt; font-family: "Courier New"; color: black;">

style="font-size: 10pt; font-family: "Courier New"; color: purple;">"$Sample_Data/Fitness.jmp"

style="font-size: 10pt; font-family: "Courier New"; color: black;">
)

style="font-size: 10pt; font-family: "Courier New"; color: navy;">;

style="font-size: 10pt; font-family: "Courier New"; color: black;">





style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">Clear
Log

style="font-size: 10pt; font-family: "Courier New"; color: black;">()

style="font-size: 10pt; font-family: "Courier New"; color: navy;">;

style="font-size: 10pt; font-family: "Courier New"; color: black;">





style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">Write

style="font-size: 10pt; font-family: "Courier New"; color: black;">(

style="font-size: 10pt; font-family: "Courier New"; color: black;">

style="font-size: 10pt; font-family: "Courier New"; color: purple;">"Test,
Col, Sample"

style="font-size: 10pt; font-family: "Courier New"; color: black;">
)

style="font-size: 10pt; font-family: "Courier New"; color: navy;">;

style="font-size: 10pt; font-family: "Courier New"; color: black;">





style="font-size: 10pt; font-family: "Courier New"; color: black;">IRChart

style="font-size: 10pt; font-family: "Courier New"; color: navy;">=

style="font-size: 10pt; font-family: "Courier New"; color: black;">
Control Chart(





style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="">     
Group
Size(

style="font-size: 10pt; font-family: "Courier New"; color: teal;">1

style="font-size: 10pt; font-family: "Courier New"; color: black;">
)

style="font-size: 10pt; font-family: "Courier New"; color: navy;">,

style="font-size: 10pt; font-family: "Courier New"; color: black;">





style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="">     
KSigma(

style="font-size: 10pt; font-family: "Courier New"; color: teal;">3

style="font-size: 10pt; font-family: "Courier New"; color: black;">
)

style="font-size: 10pt; font-family: "Courier New"; color: navy;">,

style="font-size: 10pt; font-family: "Courier New"; color: black;">





style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="">     
Chart
Col(

style="font-size: 10pt; font-family: "Courier New"; color: navy;">:

style="font-size: 10pt; font-family: "Courier New"; color: black;">Oxy

style="font-size: 10pt; font-family: "Courier New"; color: navy;">,

style="font-size: 10pt; font-family: "Courier New"; color: black;">
Individual Measurement )

style="font-size: 10pt; font-family: "Courier New"; color: navy;">,

style="font-size: 10pt; font-family: "Courier New"; color: black;">





style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="">     
Chart
Col(

style="font-size: 10pt; font-family: "Courier New"; color: navy;">:

style="font-size: 10pt; font-family: "Courier New"; color: black;">Runtime

style="font-size: 10pt; font-family: "Courier New"; color: navy;">,

style="font-size: 10pt; font-family: "Courier New"; color: black;">
Individual Measurement )





style="font-size: 10pt; font-family: "Courier New"; color: black;">)

style="font-size: 10pt; font-family: "Courier New"; color: navy;">;

style="font-size: 10pt; font-family: "Courier New"; color: black;">





style="font-size: 10pt; font-family: "Courier New"; color: black;">IRChart

style="font-size: 10pt; font-family: "Courier New"; color: navy;"><<

style="font-size: 10pt; font-family: "Courier New"; color: black;">
Alarm Script(

style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">Write

style="font-size: 10pt; font-family: "Courier New"; color: black;">(

style="font-size: 10pt; font-family: "Courier New"; color: black;">

style="font-size: 10pt; font-family: "Courier New"; color: purple;">"\!N"

style="font-size: 10pt; font-family: "Courier New"; color: navy;">,

style="font-size: 10pt; font-family: "Courier New"; color: black;">
qc_test

style="font-size: 10pt; font-family: "Courier New"; color: navy;">,

style="font-size: 10pt; font-family: "Courier New"; color: black;">

style="font-size: 10pt; font-family: "Courier New"; color: purple;">","

style="font-size: 10pt; font-family: "Courier New"; color: navy;">,

style="font-size: 10pt; font-family: "Courier New"; color: black;">
qc_col

style="font-size: 10pt; font-family: "Courier New"; color: navy;">,

style="font-size: 10pt; font-family: "Courier New"; color: black;">

style="font-size: 10pt; font-family: "Courier New"; color: purple;">","

style="font-size: 10pt; font-family: "Courier New"; color: navy;">,

style="font-size: 10pt; font-family: "Courier New"; color: black;">
qc_sample )
)

style="font-size: 10pt; font-family: "Courier New"; color: navy;">;

style="font-size: 10pt; font-family: "Courier New"; color: black;">





style="font-size: 10pt; font-family: "Courier New"; color: black;">

 





style="font-size: 10pt; font-family: "Courier New"; color: black;">IRChart

style="font-size: 10pt; font-family: "Courier New"; color: navy;"><<

style="font-size: 10pt; font-family: "Courier New"; color: black;">
(

style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">Column

style="font-size: 10pt; font-family: "Courier New"; color: black;">[

style="font-size: 10pt; font-family: "Courier New"; color: purple;">"Oxy"

style="font-size: 10pt; font-family: "Courier New"; color: black;">]

style="font-size: 10pt; font-family: "Courier New"; color: black;">

style="font-size: 10pt; font-family: "Courier New"; color: navy;"><<

style="font-size: 10pt; font-family: "Courier New"; color: black;">
All Tests)

style="font-size: 10pt; font-family: "Courier New"; color: navy;">;

style="font-size: 10pt; font-family: "Courier New"; color: black;">





style="font-size: 10pt; font-family: "Courier New"; color: black;">IRChart

style="font-size: 10pt; font-family: "Courier New"; color: navy;"><<

style="font-size: 10pt; font-family: "Courier New"; color: black;">
(

style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">Column

style="font-size: 10pt; font-family: "Courier New"; color: black;">[

style="font-size: 10pt; font-family: "Courier New"; color: purple;">"Runtime"

style="font-size: 10pt; font-family: "Courier New"; color: black;">]

style="font-size: 10pt; font-family: "Courier New"; color: black;">

style="font-size: 10pt; font-family: "Courier New"; color: navy;"><<

style="font-size: 10pt; font-family: "Courier New"; color: black;">
All Tests)

style="font-size: 10pt; font-family: "Courier New"; color: navy;">;

style="font-size: 10pt; font-family: "Courier New"; color: black;">





style="font-size: 10pt; font-family: "Courier New"; color: black;">

 





style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">Save
Log

style="font-size: 10pt; font-family: "Courier New"; color: black;">(

style="font-size: 10pt; font-family: "Courier New"; color: black;">

style="font-size: 10pt; font-family: "Courier New"; color: purple;">"C:\Try\Savelog.txt"

style="font-size: 10pt; font-family: "Courier New"; color: black;">
)

style="font-size: 10pt; font-family: "Courier New"; color: navy;">;

style="font-size: 10pt; font-family: "Courier New"; color: black;">





style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">Open

style="font-size: 10pt; font-family: "Courier New"; color: black;">(

style="font-size: 10pt; font-family: "Courier New"; color: black;">

style="font-size: 10pt; font-family: "Courier New"; color: purple;">"C:\Try\Savelog.txt"

style="font-size: 10pt; font-family: "Courier New"; color: navy;">,

style="font-size: 10pt; font-family: "Courier New"; color: black;">
labels(

style="font-size: 10pt; font-family: "Courier New"; color: teal;">1

style="font-size: 10pt; font-family: "Courier New"; color: black;">
)
)

style="font-size: 10pt; font-family: "Courier New"; color: navy;">;
satish

Community Trekker

Joined:

May 29, 2012

Hi mpb, could you please re-post the script? I am trying to do the same but somehow it writes fine to the log but not to the table.

satish

Community Trekker

Joined:

May 29, 2012

Got this one...

Chart Col( Column( dttarget, paramname ), Individual Measurement, Moving Range ),

  Alarm Script(

  Write(

  QC_Test,

  ",",

  QC_Col,

  ",",

  QC_Sample,

  ",",

  QC_FirstRow,

  ",",

  QC_LastRow,

  ",",

  fldid,

  ",",

  tmppartno,

  ",",

  SessionID,

  "\!N"

  );

  dtTestResults = Data Table( "TestResults" );

  dtTestResults << add rows(

  {:QC_Test = QC_Test, :QC_Col = QC_Col, :QC_Sample = QC_Sample, :QC_FirstRow = QC_FirstRow}

  );