Hi I have a variables that is declared outsides fucntions. How can I use and change these variables inside function usign Python? thank you
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
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:
See less[crayon-67642432b6438771927201/]
This code will print:
[crayon-67642432b643e387963216/]