Variables not used warning (Safety)

Hi, I am getting a lot of variable not used warnings when I’m compiling the software even though it is used and the crossreference is updated. I think it is just external variables used in safety function blocks. Is this a known issue or am I doing something wrong? Best regards Stefan

Hi Stefan,

I’ll discuss about this issue with PM of PLCnEng and give you a feedback as soon as possible. Could you provide me the screenshot of your PLCnEng project with used Librarys and showed Warnings, please? Thanks & Best Regards, Eduard

Hi Eduard, Here is a screenshot from the project and library folder. /Stefan


Hi Stefan, I can’t see the FB name or the name of included library, could you give me information about the included library name and FB name, please? I can see only one safety library “PLCopen_SF” in the library list, are you use this library? Best Regards Eduard

Hi Eduard, I’m not shure what you mean but I will try to explain one faulty variable, I’ve attached a file with the view of components. The example variable “DATA_VALID_BARRIER2” is set in HardwareReInit wich is called in S_Main and is then read on the input of S_BarrierFB that also is called in S_Main. I tried to replicate the problem in a small project but it worked there. /Stefan

Hello Stefan, I would like to verify this behavoir, please upload your PLCnEng project with warning messages. I assume you have not used Global/External Variables in your project. You can also try to delete all not used variables and compile you project again. For uploading data to the ShareFile server, please use the following server link: https://phoenixcontact.sharefile.eu/r-rf06a5b174e44ecf8 Thanks & Best Regards

Eduard

Hi Eduard, The variables is external and globally used. I have tried to delete and recreate variables but the warning comes back I have uploaded the project. /Stefan

Hello Stefan, thanks for the PLCnEng project upload, we will analysze the warning messages and give you a feedback as soon as possible. Best, Eduard

Hi Stefan, it took a while to find the cause. The reason for the issue is that you are using in your application two POEs (DummySafetyFunction and MyTest). After deleting those POEs everything works fine.

We will improve the diagnostics in one of the next versions. Take care, Frank

Hi Frank, Thanks for the help finding this issue/bug. Best regards Stefan Svanbäck