Diving even deeper, any Periodic task is going to contain one or more Programs, and each of those Programs can be Inhibited by means of an SSV.
Thus the OP could leave the Task alone, but kill one program and leave others running.
Or do as daba suggested, and disable a Routine within the Program by use of a TND, or a conditional JSR.
But all of these techniques, while they will work, obscure the bigger picture of "Why?". These practices of enabling and disabling code, are more common in other programming languages, like C++, than in PLC programming.
In "disabled" code, OTEs don't reset their outputs, particularly real-world ones, which lead to "duplicate destructive bit" coding. TONs that have been enabled still keep track of time, even if the .ACC isn't "ticking", and so forth.
Not good programming technique.
OTEs don't reset their outputs, particularly real-world ones,
Any tag referenced by an OTE is reset on power up or program to run transition. Unscheduled? Hmmm. not so sure.
You're forgetting that we upside-down folk get to Monday morning a lot earlier than you right-way-up folk, daba
Fortunately for you, I remember that we had this discussion last year, and you quite comprehensively tested many scenarios, including unscehduled tasks: http://www.plctalk.net/qanda/showthread.php?t=110282&page=4
See posts 56 and onward
Sorry for the delayed reply. Thank you all for your responses. Reason wanting to Disable/Enable this is customer wants an option to log data from 10 tags at a rate of 100 samples a second for a short period of time at a time of their choosing vs the normal data log rate of 10 samples a second where a test can run for several days. Even though the entire program has a scan time of less than 4ms including the 10ms and 100ms periodic tasks running concurrently with the main task. However, one of the periodic task will be logging data at any given time. Just wanting to figure out a way to disable the 10ms task as they would may be run that for few hours once every six months where as the 100ms task logging data takes place on a daily basis.
Thanks again for everyone's help.
Cheers.