PropertyReference failed to read value

Hello! I have some issues with historical tag readings.

We work with 3 shifts daily. From 06:00 to 14:00, from 14:00 to 22:00 and from 22:00 to 06:00; I have to make a perspective page to show the faults count and as a percentage of the overall cycles (B. in the picture below), for every 8 hour shift previous, limited to 20 shifts before.

For that I make a table with a history tag binding for all the fault counters (tags) and have the following for historic dates:

Start Date = dateArithmetic({view.custom.date},-(480*{../shifts_back.custom.value}),"minutes")
End Date = dateArithmetic({view.custom.date},-(480*{../shifts_back.custom.value}),"minutes")

In my view I have a custom property that will select the current shift start date:

if (getHour24(now())>= 6 && getHour24(now())< 14, dateFormat(now(),'yyyy-MM-dd 06:00:00'),
 	
 		if(getHour24(now())>= 14 && getHour24(now())< 22, dateFormat(now(),'yyyy-MM-dd 14:00:00') ,
 		
 		if(getHour24(now())>= 22 && getHour24(now())< 23, dateFormat(now(),'yyyy-MM-dd 22:00:00'),		
 		
 
 		dateArithmetic(midnight(now()),-2,'hours') 
 )))

The buttons are to move back and forth between previous shifts and change the number of the property for number of shift (0-20), so depending on the amount of shifts the user wants to go back, the:

dateArithmetic({view.custom.date},-(480*{../shifts_back.custom.value}),"minutes")

should return the desired date (I use it for both start date and end date).

It was working until the last 6 shifts, now I get a log warning that says PropertyReference failed to read value, for A. and B. (in the Picture above) and same for the table

Does anyone know what the problem might be? Should I come up with another way to set the start and end dates? I only want the last value before the end of the shift that is to be looked at

First problem: Start and End are identical! Is that fixed elsewhere?

But it was working before. Even if I put a start date 2-3 days before it shows 0 or gives the error

You must have changed something.

A couple of observations:

if (getHour24(now()) >= 6 && getHour24(now()) < 14, 
        dateFormat(now(), 'yyyy-MM-dd 06:00:00'),
    if(getHour24(now()) >= 14 && getHour24(now())< 22, 
       dateFormat(now(),'yyyy-MM-dd 14:00:00'),
        if(getHour24(now()) >= 22 && getHour24(now()) < 23,
            dateFormat(now(),'yyyy-MM-dd 22:00:00'),		
         	dateArithmetic(midnight(now()),-2,'hours') 
 )))

I don’t think you should need to format as a string. If the values are passed back as datetime type Ignition should handle it properly. That would allow you to use:

if (getHour24(now()) >= 6 && getHour24(now()) < 14,     
    addHours(midnight(now(), 6),
    if(getHour24(now()) >= 14 && getHour24(now())< 22, 
        addHours(midnight(now(), 14),
        if(getHour24(now()) >= 22,
            addHours(midnight(now(), 22),
        	addHours(midnight(now()), -2) 
 )))

The other comment is that green seems a strange choice to show the number of faults. It generally signals that things are going well. I encourage you to use Perspective Built-In Themes - Ignition User Manual 8.1 - Ignition Documentation and have a look at some good GUI / HMI guides. Use color sparingly, consistently and always with a purpose.

1 Like

Though the date string works, I changed to your recommendation for better practice! :slight_smile:
I played a bit with the historian parameters and it is sort of working again, but I decided to change to a transaction group with the shift schedule and use queries to bring the data up.

Regarding the other comment, as long as they are under 1%, they should be displayed green. However when they should appear red... I did not know how to change the style of the bar chart. I will give that documentation a look, I bet it will help.

Thank you very much for the input anyway!

Actually, if I remember correctly the chart components don’t understand the Ignition theme variables. Keep doing what you’re doing for the charts.

1 Like