cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Ronaldo
Level II

How to Process Continuous Alarm Data Using a JMP Script

I want to count the number of times an alarm occurs in the process. The data comes in every second. When an alarm occurs, the data shows 1, and if the worker doesn’t turn off the alarm, the number 1 continues to appear.

The problem is, if the alarm is not turned off within 10 seconds, it actually counts as one alarm but appears as 10 alarms in the data.

I want to leave only one row and delete the rest when the time is continuous. How can I write the script to do this?

data is here.
A column : time data 2024-06-06 13:23:30
B column : alarm data : 1 or 0
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: How to Process Continuous Alarm Data Using a JMP Script

If your data is sorted you can use formula like

	If(Dif(:B) == 1,
		1
	, :B == 1,
		0
	,
		-1
	);

to mark rows. Then pick rows with values 0 and delete those

jthi_0-1718102568571.png

 

-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: How to Process Continuous Alarm Data Using a JMP Script

If your data is sorted you can use formula like

	If(Dif(:B) == 1,
		1
	, :B == 1,
		0
	,
		-1
	);

to mark rows. Then pick rows with values 0 and delete those

jthi_0-1718102568571.png

 

-Jarmo
Ronaldo
Level II

Re: How to Process Continuous Alarm Data Using a JMP Script

thank you. I should have thought about it a little more.

Recommended Articles