Thanks for the chance to assist
A commander has a great deal of discretion in issuing orders for his command. As long as the order is not otherwise illegal (like if the commander ordered one of his soldiers
to steal from the exchange) and as long as there is some military purpose that relates to the order, the order will most likely be valid. If the order is valid and the soldier disobeys, they can be prosecuted for failure to follow the order
From your description, it sounds like this no contact order relates to you and another servicemember. I suspect that the order will be legal if the commander believes that he needs to enforce this order to maintain good order and discipline in his or her command.
Now, if there is a need to contact the other servicemember in your legal defense, you should go to the ADC (Area Defense Counsel) and get them involved in the process. They can make sure your legal rights are protected and, if needed, work though the process of talking to witnesses you need for your defense while keeping you out of further trouble with your command.
If there is a new change based on the no contact, you will have to address these charges...the is not an "exception" to a no contact order unless its illegal. From your description it sounds like the order yo faced was legal
Now, the discretion is not limitless. If you believe the order has been in place too long or is not proper, you can file an Art 138, UCMJ complaint or you can notify your congressional representative. I would caution that the chain of command will generally support the commander unless the order is completely unfounded. And, as a general rule, reliance on hearsay is allowed to determine if the order is appropriate.
Sorry to bear bad news
Please let me know if you have further questions; if so I will do my best to answer them. If not please hit the accept button, its the only way I get paid.