PLCnext on LinkedInPLCnext on Instagram  PLCnext on YouTube Github PLCnext CommunityStore PLCnext Community

  1. alexsanchez
  2. PLCnext Engineer
  3. Friday, 22 May 2020

Hello,

I added the Alarms Lib from the PLC Next store to my project (I am using 2020.3). Then I create a program named Alarms , as in the example, and added it to my tasks.

 

But after this, I can't add any External Variables. I tried a variable named tagG and got this:

 

SEM1056   No matching global variable found for 'Main:tagG' in resource 'axcf2152_1:PLC'.

 

What does the error mean? Is "Alarms" a reserved word?

 

Thanks,

Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Hi Alex,

Are you able to create a global variable called tagG in the global (PLC) data table? Does this clear the error in your project?

~ Martin.

 

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  1. one week ago
  2. PLCnext Engineer
  3. # 1
lqplee Accepted Answer Pending Moderation
0
Votes
Undo

Yes, I am able to create a global variable called tagG inl (PLC) data table but it has to be declare as "BOOL" in the program so it can be used. "tagG" cannot be any other data types than "BOOL" now in the program when it is declared as external.

  1. one week ago
  2. PLCnext Engineer
  3. # 2
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

OK, so the data type of the External variable(s) declared in Program(s), must always match the data type of the corresponding Global variable. So if you declare the global variable tagG as BOOL, all the external Program variables of the same name must also have the type BOOL. If you want to change the type of the tagG External variable(s), this must be changed in the Global data table, and in every program.

Or perhaps I am missing something in the description of the problem?

~ Martin.

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  1. one week ago
  2. PLCnext Engineer
  3. # 3
lqplee Accepted Answer Pending Moderation
0
Votes
Undo

Hi, Martin,

    There is no field where I can change the data type in the global (PLC) data table. How can the data type of tagG be changed?

Thanks

Attachments (1)
  1. one week ago
  2. PLCnext Engineer
  3. # 4
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Hi,

You need to expand the columns by clicking here:

Global Data Table

... then you can change the data type.

~ Martin.

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  1. one week ago
  2. PLCnext Engineer
  3. # 5
lqplee Accepted Answer Pending Moderation
0
Votes
Undo

Hi, Martin,

    The above way works. I can declare global variables in the global variable table.

    The weird thing is that I can declare the external variables or in/out ports in the programs if I don't have a program named as "Alarms" with the imported "Alarms" library. With a "Alarms" program, these type of variables cannot be declared in the programs. What is the reason?

    Thanks
Jason

  1. one week ago
  2. PLCnext Engineer
  3. # 6
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Hmm, you are right. I can reproduce this behaviour without the Alarms library, simply by creating a program called "Alarms".

I will check this with my colleagues and let you know.

~ Martin.

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  1. one week ago
  2. PLCnext Engineer
  3. # 7
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

OK, so the issue I saw is that, when adding external variables to a Program, the corresponding global variable will only be added automatically if that program currently has one or more instances defined in a Task.

If the external variable was created in a program that was not instantiated, then the global variable will be created as soon as that program is instantiated in a task.

Does this explain the behaviour that you are seeing?

~ Martin.

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

lqplee Accepted Answer Pending Moderation
0
Votes
Undo

Hi, Martin,

    Whatever the program is instantiated or not, no external variable can be declared inside the program. It will give out the error message   {No Matching Global Variable Found for 'Alarms.tagGlobal' in resource 'axc-f-2152-1:PLC'}.  "tagGlobal" is the variable I tried to declare in the program.

    The above error also apply to the example project "AL_1_2_EXA.pcwex" which I downloaded from PLCNext Store.

    I tried to rename the program "Alarms" to "MyAlarms" and the error disappeared. The global variable can be declared inside any programs now.

    However, I realized that I need to import the "Alarms" web pages and this page includes many variables named as "Alarms1..FB_Alarms.xxx". If I change the program name to "MyAlarms", all variables in the "Alarms" page have to be changed to "MyAlarms1.FB_Alarms.xxx" and there is no guarantee this change will work.

    Now this is pretty critical we are facing in developing our application.

    The error can be simply verified by the example project from the "Alarm" library downloaded from the PLCNext Store.

    Could you check it?  

Thank you very much
Jason Li

  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.