cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
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.