Sorry to reply you late as I was out of office last week.
Did you set the name for the expansion monittor? the error masseage says that "in setexpansion, no expansion monitors are selected". Please set the expansion monitor name, and see if the error message shows again.
BTW: It is better to use port. and follow the online example.
You can gradually modify the online example to your design by change one object at a time and check which object causes the issue.