In deciding the length of an order, the only consideration should be the "time reasonably necessary to protect from abuse the plaintiff or any child in the plaintiff's care or custody." This doesn't mean that an order can't include provisions for visitation, but only that the impact the order has on visitation shouldn't affect the choice to issue the order or for how long. That choice is dependent solely on the necessity of the order to provide protection from abuse to the plaintiff.
When a restraining order, also know in Massachusetts as a section 209A Abuse Prevention Order, is obtained by a Plaintiff, it will include orders relating to children if the parties have minor children together. Usually a 209A restraining order will order the Defendant to stay away from any children and award custody of the children to the Plaintiff.
In Massachusetts, the District Court issues most 209A restraining orders but the Probate & Family Court can as well. Provisions relating to minor children can be amended to allow visitation, but typically the District Court would prefer that the Probate & Family Court deal with those provisions. If a party requests a parenting time schedule from the Probate & Family Court, the Judge in that court can amend the restraining order through a process we discussed in this previous post.
The provisions relating to visiting the children don't change the orders preventing abuse of the parent, but practical considerations (like pick-up and drop-off of the children) may need to be considered to avoid violation of no-contact provisions.