Passing Parameters

I’m not getting this. I want to pass a single item (number) from a source to a destination window. On the button I’m using to open the target (the event handler) I click the Pass Parameters box and enter a property (label text) on the source window. I can’t seem to figure out the ‘Parameter Name’ value. I assume that’s the property on the destination window but every combination I’ve tried causes an error. How do I accomplish this?

Kurt

The “parameter name” is the name of the custom property you add to the root container of the destination window. What error are you getting, and what version of Ignition are you using?

In the target window I’m trying to get at the parameter ‘StationNumber’ using the internalFrameActivated event. I get: “NameError: StationNumber” My script is:

tmp = StationNumber
lblStationName.text = "Station " + str(tmp)

I’m using 7.3.3

I assume “StationNumber” is a custom property of the root container, right? Also, is lblStationName a label component on the destination window? If so, you’ll need to use the event object to properly access those components in the hierarchy:

rc = event.source.rootContainer tmp = rc.StationNumber rc.getComponent("lblStationName").text = "Station " + str(tmp)

For more information about using the event object and working with components:

inductiveautomation.com/support/ … object.htm
inductiveautomation.com/support/ … onents.htm

Is there anyway to address the propery directly? For example, if I want to modify a table select statement based on a propery value.

Are you using the table select statement in a script? If so, runPrepQuery allows you to reference a variable using a placeholder:

inductiveautomation.com/support/ … pquery.htm