Hello,
I currently have a module (Module A) that has a set of external references to other modules. I would like to be able to access the module tag name of these referenced modules, so that they can be shown on the faceplate of Module A. Is there an easy way to do this? I tried to access it directly through a parameter but was unable to.
OMB,
Try the suffix ".A_$REF" to get the tag name as a string from an external reference.
If you have an external reference in MODULE_A called PARAM1 that is pointing to the parameter PARAM2 in MODULE_B. In the faceplate of MODULE_A an alpha-numeric datalink with the source "DVSYS.@mod@/PARAM1.A_$REF" would display the text "MODULE_B/PARAM2" on the faceplate.
If you want to pull out the module name only then use some code in the faceplate's initialize routine like the split function to write the result into a variable and display its contents as a datalink on the faceplate. Don't forget the datalink needs ".currentvalue" at the end. Here is an example of the code. You could extend it to read through a series of references.
I hope this helps.
RP
Private Sub CFixPicture_Initialize()
On Error GoTo ErrorHandler
'Display external ref source modules Dim lngCmdStatus As Long 'Status of module parameter read (0=good) Dim sLink As String 'Contents of parameter read Dim sTag As String 'Name of parameter to read Dim sAddress() As String 'Array to contain address from external ref
TGCounter = 0
sTag = Me.ps_nm.CurrentValue & "/PARAM1.A_$REF" 'Assemble string to read module description sLink = frsReadValue(sTag, lngCmdStatus) 'Read module description into sDesc If lngCmdStatus = 0 Then 'If read is good proceed, otherwise do nothing. sAddress = Split(sLink, "/") 'Split address using / delimiter Me.ps_Param1_Address.CurrentValue = sAddress(0) 'Read module name from before / into variable and ... End If '... display in datalink on faceplate
Exit Sub
ErrorHandler: frsHandleError
End Sub