What is wrong with this expression>
if {[.]../Program:_02_ED1/_02FT104/AnalogueInput/ScaledValue.value} >=1 && {[~]BPED_FedRec/MSG_Read_BPED_FR/DiscreteInput/MSG_DINT_1_2}=true ,(mean({[.]../Program:_02_ED1/_02FT104/AnalogueInput/ScaledValue.value}, now(60000))
I need another set of eyes please.
If nothing else your if
is missing its opening (
. It looks like you've got a stray one further in the expression before mean
.
- Unreadable and hence undebuggable. Use linebreaks. Use indentation. Add spaces before and after operators.
- Missing opening
(
.
- Missing
else
condition.
- Redundant
= true
.
Try this.
if(
// test
{[.]../Program:_02_ED1/_02FT104/AnalogueInput/ScaledValue.value} >= 1
&&
{[~]BPED_FedRec/MSG_Read_BPED_FR/DiscreteInput/MSG_DINT_1_2},
// true
mean(
{[.]../Program:_02_ED1/_02FT104/AnalogueInput/ScaledValue.value},
now(60000)
),
// false
-1 // Value to return if conditions not met.
)
1 Like
What exactly to you expect to get from the mean()
function when supplying a value and a timestamp?
@Transistor , Thank you very much!!!
1 Like
I'd also suggest not simply dragging tags from the plc into ignition, as the folder structure is almost guaranteed to not be useful for efficient development in ignition