I have one strange issue, I'm not experienced enough to understand.
We have generated one FC for scaling and writing to analog outputs, which we use as standardized interface for analog control.
I use it on more than 100 places in my project for one PLC.
In one FC I call this AO, and for channel fault output I assigned one temporary bit variable. I check this temporary variable for channel fault and generate an alarm for HMI if it's on.
I use it like this so I can have easy copy-paste between FCs dedicated for analog control, no need to create hundreds of global variables.
But what happens is some very strange behavior.
This AO FC is not called during testing, since we're still simulating. But alarms related to channel fault appeared in HMI, which should be impossible, since functions for analog reading and writing are disabled during simulation test.
I checked software and only thing that could be is this temporary variable I assigned as channel fault. I checked if this temporary variable goes ON, and it went ON no matter AO FC which writes it is not called!!
Then I went into one FC and forced temporary variable to be always true, which then generated alarm of HMI. But not only for FC where I forced it, but for all FCs using using temporary variable with that name!
This should be impossible by my understanding of how temporary variables work. What could be the problem?
We have generated one FC for scaling and writing to analog outputs, which we use as standardized interface for analog control.
I use it on more than 100 places in my project for one PLC.
In one FC I call this AO, and for channel fault output I assigned one temporary bit variable. I check this temporary variable for channel fault and generate an alarm for HMI if it's on.
I use it like this so I can have easy copy-paste between FCs dedicated for analog control, no need to create hundreds of global variables.
But what happens is some very strange behavior.
This AO FC is not called during testing, since we're still simulating. But alarms related to channel fault appeared in HMI, which should be impossible, since functions for analog reading and writing are disabled during simulation test.
I checked software and only thing that could be is this temporary variable I assigned as channel fault. I checked if this temporary variable goes ON, and it went ON no matter AO FC which writes it is not called!!
Then I went into one FC and forced temporary variable to be always true, which then generated alarm of HMI. But not only for FC where I forced it, but for all FCs using using temporary variable with that name!
This should be impossible by my understanding of how temporary variables work. What could be the problem?