how can i access the internal variables of a function block from freelance?
It's bit contradictory, fact that there can be a internal variable of User function block (UFB), But as you replied not a user but pre built function block. means it's default function block. then default function block doesn't have internal variables. Default function block is having Input/Output pins and Parameterisation.
Input/output pins you can directly connect to modbus read/write block,that is straight forward. but parameters you can only access via OPC as component of Tag. i.e tag.parameter.
So internal variable you are reffering to parameters of default(prebuilt) function block or it is User function block ?
Hope this helps...