cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

ThingWorx Navigate is now Windchill Navigate Learn More

Translate the entire conversation x

Issue with Alarm Count in Reports for "This Shift"/"Last Shift" Filters

Aishwarya_Patil
7-Bedrock

Issue with Alarm Count in Reports for "This Shift"/"Last Shift" Filters

Hello All,


I am currently using AMU and have configured some alarms on the equipment, which are being triggered as expected. However, I’ve noticed an issue with the Alarm Reports.

 

When I apply the "This Shift" or "Last Shift" filters, the alarm count shows as 0. On the other hand, when I select the "Today" filter, the alarm count is displayed correctly.

 

Please help in understanding why the count is not appearing for the shift-based filters?

Regards,

Aishwarya Patil

ACCEPTED SOLUTION

Accepted Solutions

Hi

 

Shift Events absolutely need both the date and the time. If you have 3 shifts per day, then you will have 21 shift events in your week and you must import all 21 records. For a year that's 1095 records.

 

In Excel, here's an example on how to do this : 

mstarnaud_1-1737643363206.png

- Write example dates & times for your pattern. In my example, I filled the start & end times of my 1st day (3 shifts per day, so 3 records). 

- For all following records : in an extra column to the right, write just the time portion that you want to add from the previous records. For example to add 24h (next day), then write 24:00:00 in the extra column.

- For all following records : the time will be [cell containing the pattern's time] + [cell containing the time to add]. In my example, the E5 cell's formula is =E2+G5. You can use similar methods to fill the shift & crew columns (in my example, C5's formula is =C2).

- Use the little "expand" button at the bottom-right of the cells to quickly copy these formulas for as long as you want.

- Pay attention to the days when there will be a daylight saving change, confirm if you need to change the time when you reach those days.

 

What most people do is they fill the data for the entire year, then set a reminder in early December to do it for the following year. Also most people only do it for a few of their top-level equipments, since their children will inherit from the parents : most people do it at the factory-level equipment(s).

 

And as a reminder, there must be no gap in your records. If your shift change is at 08:00, then the previous shift ends at 08:00 (not 07:59) and the next starts at 08:00. And if there is a shift where no work will be done, you must still fill it with data but you can use different shifts & crews, like NoShift & NoCrew instead of Night & Team1.

View solution in original post

7 REPLIES 7

Hi Aishwarya

 

Are you sure that you correctly configured your shifts?

 

To see the existing shift configuration, start by going in the Configuration -> Equipments screen. Note the displynames of your equipment and all of its parents. As a reminder you can configure shifts at any level of the hierarchy. If an equipment doesn't have shifts then will use the ones from its parent, grandparent, and so on. A lot of people set the shifts at the factory level.

 

Then go in the Configuration -> Shift And Crew screen -> Shift Events tab. Select the equipment and all its parents. Select the This Month filter. This will show all existing shifts on those equipments. If the grid is empty, it's because you have no shift configured.

 

If you have access to do SQL queries, you can also try to run this query (change the EquipmentUid at the top) to see if the system can find This Shift for your equipment. If the query returns nothing, then it can't find it.

DECLARE @EquipmentUidList NVARCHAR(MAX) = 'EQUIPMENT_UID_GOES_HERE' -- CHANGE THIS
DECLARE @TimeRangeList NVARCHAR(MAX)
EXEC MnfgCommon_QuickTimeIntervalList_SP
	@op_TimeRangeList = @TimeRangeList OUTPUT,
	@p_QuickTimeIntervalUID = 1, -- 1=ThisShift, 2=LastShift
	@p_EquipmentUIDList = @EquipmentUidList,
	@p_IsRoundingDown = 0
SELECT	[UID],
		StartTime,
		EndTime
FROM  	OPENJSON(@TimeRangeList, '$')
WITH
(
	[UID]		BIGINT		'$.UID',
	StartTime	DATETIME	'$.StartTime',
	EndTime		DATETIME	'$.EndTime'
)

 

Hello mstarnaud,


Thank you for your response and detailed guidance regarding shift configuration.

You were correct—I had not configured the shift events earlier and instead created a custom shift table to use across my custom dashboards. Currently, I am exploring the shift configuration feature, but I’m facing a challenge:

  • When defining a recurring shift using only the time (e.g., for a third shift starting at night and ending after midnight the next day), I encounter an error stating, "Shift Events Start Time must be before End Time."
  • To bypass this, I tried including a specific date along with the time, and while this removes the error, the shift gets applied only to that specific day and not recurring across the following days.

Is there a way to configure recurring shifts based solely on the time (without specifying dates), so that shifts like the third shift (starting at night and ending the next day) can be defined properly?

Regards,
Aishwarya Patil.

Hi

 

Shift Events absolutely need both the date and the time. If you have 3 shifts per day, then you will have 21 shift events in your week and you must import all 21 records. For a year that's 1095 records.

 

In Excel, here's an example on how to do this : 

mstarnaud_1-1737643363206.png

- Write example dates & times for your pattern. In my example, I filled the start & end times of my 1st day (3 shifts per day, so 3 records). 

- For all following records : in an extra column to the right, write just the time portion that you want to add from the previous records. For example to add 24h (next day), then write 24:00:00 in the extra column.

- For all following records : the time will be [cell containing the pattern's time] + [cell containing the time to add]. In my example, the E5 cell's formula is =E2+G5. You can use similar methods to fill the shift & crew columns (in my example, C5's formula is =C2).

- Use the little "expand" button at the bottom-right of the cells to quickly copy these formulas for as long as you want.

- Pay attention to the days when there will be a daylight saving change, confirm if you need to change the time when you reach those days.

 

What most people do is they fill the data for the entire year, then set a reminder in early December to do it for the following year. Also most people only do it for a few of their top-level equipments, since their children will inherit from the parents : most people do it at the factory-level equipment(s).

 

And as a reminder, there must be no gap in your records. If your shift change is at 08:00, then the previous shift ends at 08:00 (not 07:59) and the next starts at 08:00. And if there is a shift where no work will be done, you must still fill it with data but you can use different shifts & crews, like NoShift & NoCrew instead of Night & Team1.

Hello  mstarnaud,

Thanks for the detailed explanation. I’ve now successfully configured the shifts. However, when I tried updating a shift event, such as changing the crew name for a particular shift event, I encountered the error:
"Shift Events cannot overlap other records in the database on Equipment."

Could you clarify if updating a shift event is allowed in this case? If updates are restricted, what’s the recommended method to change or update a shift event without running into this overlap error?

Thank you .

Hi

 

Sadly, I think there is no way to edit the shift events using the screen/UI. Or at least I've never been able to do it. The only way I know how to do it is by updating the ShiftEvent table in SQL.

 

To use SQL, you can either connect using SQL Studio (SSMS), or go in Composer and find your SQL Thing (I think the default name is PTCFSU.CoreSQLThing) and add a service on it. To get the already-existing information, you can use this query : 

SELECT	se.uid,
		se.equipmentuid, e.name 'EquipmentName', e.displayname,
		se.starttime, se.endtime,
		se.crewdetailuid, cd.name 'CrewName',
		se.shiftdetailuid, sd.name 'ShiftName',
		se.productiondate, se.username
FROM	shiftevent se
JOIN	equipment e		ON	e.uid = se.equipmentuid
JOIN	crewdetail cd	ON	cd.uid = se.crewdetailuid
JOIN	shiftdetail sd	ON	sd.uid = se.shiftdetailuid
ORDER
BY		e.name			ASC,
		se.starttime	ASC

And then when you edit a value, your query will probably be like this :

UPDATE se
SET se.COLUMN_NAME_HERE = 'VALUE_HERE' -- change this
FROM shiftevent se
WHERE se.uid = UID_HERE -- change this

Note that in SQL, all times will appear in UTC. 

 

Hello,

Yes, I modified it directly from the database table. I just wanted to confirm if there is any way to update it from the UI. Thank you!

I have reached my colleagues and they confirmed that the UI/import only allows creating new records, to edit or delete we are forced to use SQL. We do have this enhancement in the todo list (PSPT-75841) but it has no release date planned yet.

Announcements


Top Tags