Vision Popup UDT Script Failure

Hello! I have made a template that uses a tab strip to 'select' different views for the operator. The issue I am having though is that when I try to do a button press, my old "button script" code is failing to pull the motors number to navigate to the correct tag to write to.

I have added the "MotorNumber" data type to the "Home" container - but I believe the issue is that my script is going off inside of the "Home" tab and therefore it doesnt have the MotorNumber.Dynamictagtie passed to it. Should I write scripting on the tag script to pass parameters to these containers to resolve?

I am using the M_10500 motor as an example, which is a UDT of type PMTR - The tag browser hierarchy is shown in the screenshot.

Screenshot is the python console from the button press, along with the script itself.

value = 1
system.tag.writeBlocking([str(event.source.parent.MotorNumber.DynamicTagTie) + "/O/OCmd_Start1"], [value])

print str(event.source.parent.MotorNumber.DynamicTagTie) + "/O/OCmd_Start1"

Which container or component is your MotorNumber parameter on? It seems like it may be placed on a couple of components, one of them not being populated with a value (empty string giving you the "None" part of your tag path). If you have a MotorNumber parameter on the Root Container (as you may be passing this into the popup as a parameter) as well as the "Home" grouping of components, you'll want to bind the Home.MotorNumber parameter to the Root Conainer.MotorNumber parameter.

1 Like

Aha - Thats what I ended up doing - just binding the paramater in the non-root container to the one that is passed through from the template that opens the popup.

Thanks! I was trying to do that in a way harder way by scripting the tab strip, but binding the inner parameter to outer parameter fixed it.