Hello:
I am working on TwinCAT 3. I have a variable 'Allow_Control'. Whenever this variable is 'TRUE' I want the Function FCN_ON_ACSwitch(); to run otherwise when it is FALSE I don't want the function to run. It looks like this statement is not working.
If Allow_Control=TRUE THEN FCN_ON_ACSwitch();
ELSE NOT FCN_ON_ACSwitch();
END_IF.
And what happens when I am using a program instead of a function. As Operational(); is my another program and COM(); is my MAIN program. I am running Operational(); in COM(). If Allow_Control is 'TRUE' I also want Operational(); to run otherwise it should not run from COM. Please have a look at the attachments.
Any help will be highly appreciated. Thanks in advance.
I am working on TwinCAT 3. I have a variable 'Allow_Control'. Whenever this variable is 'TRUE' I want the Function FCN_ON_ACSwitch(); to run otherwise when it is FALSE I don't want the function to run. It looks like this statement is not working.
If Allow_Control=TRUE THEN FCN_ON_ACSwitch();
ELSE NOT FCN_ON_ACSwitch();
END_IF.
And what happens when I am using a program instead of a function. As Operational(); is my another program and COM(); is my MAIN program. I am running Operational(); in COM(). If Allow_Control is 'TRUE' I also want Operational(); to run otherwise it should not run from COM. Please have a look at the attachments.
Any help will be highly appreciated. Thanks in advance.