Hi Everyone! I use a s7-1500 controller. I use MB_CLIENT function to read data from an other PLC. Everything work fine until I make change in my project and download to the PLC. I have error 80A3 and impossible to acknowledge until I make a stop/Run of the plc. Anyone can help me? Best Regards,
Follow this example to create a variable outside functions, and use it inside the functions: MyVariable = 99 #this is a global variable def changeAndPrint_GlobalVariable(): global MyVariable #use global variable in this function with "global" keyword print('Global variable "MyVariable" before changeRead more
Follow this example to create a variable outside functions, and use it inside the functions:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | MyVariable = 99 #this is a global variable def changeAndPrint_GlobalVariable(): global MyVariable #use global variable in this function with "global" keyword print('Global variable "MyVariable" before change = ', MyVariable) # the global variable is printed MyVariable = 1 #change the value of the global variable is printed print('Global variable "MyVariable" after change = ', MyVariable) # the global variable is printed def changeAndPrint_LocalVariable(): MyVariable = 77 #this is a local variable print('Local variable "MyVariable" = ', MyVariable) #the local variable is printed changeAndPrint_GlobalVariable() #call the function changeAndPrint_LocalVariable() #call the function |
This code will print:
1 2 3 4 | Global variable "MyVariable" before change = 99 Global variable "MyVariable" after change = 1 Local variable "MyVariable" = 77 |
See less



Hi Maesa, If you use instances declared in a FB function. Try to use a global instance of MB_clien like this: use a global DB to declare the "ModbusDataconnectParamClient" structure. This will fix your problem and when you download the project, it will not cause problem for MB_client function. hopeRead more
Hi Maesa,
If you use instances declared in a FB function.
Try to use a global instance of MB_clien like this:
use a global DB to declare the “ModbusDataconnectParamClient” structure.
This will fix your problem and when you download the project, it will not cause problem for MB_client function.
hope this will help you
See less