hi all, does anyone know the format of the vb code i would use if i wanted to change the primary graphic on a different operator station to the one that would be executing the vb code?
In reply to Digital Technician:
In reply to Stuart Jolley:
In reply to Brian Atkinson:
To expand on what Brian said, I can share what I did in similar situation. I created a string parameter in the toolbar for the "remote" workstation called ps_NewPicture. I animated the value and tied it to a control module parameter, DISPLAY_AGENT/NEWPICNAME.A_CV. I then created an OnChange event for the toolbar parameter. Now, any time the value in the control module changes, the animated value of the toolbar parameter changes and the OnChange event fires the VB code. You can use the frsReplacePictureOnScreen function in your VB code. Your _OnChange event code might look something like: Private Sub ps_NewPicture_OnChange() Dim NewPicName As String NewPicName = frsReadValue("DVSYS.DISPLAY_AGENT/NEWPICNAME.A_CV") If Not frsIsPicOpen(NewPicName) Then frsReplacePictureOnScreen NewPicName, 1 End If Exit Sub ErrorHandler: frsHandleError End Sub I took it one step further for demonstrations. I wanted to open multiple displays on multiple workstations (or Remote Client Sessions), and also open faceplates. I used the same principle, but with Boolean triggers for the OnChange events and a composite for each workstation in a control module. The composite has Boolean triggers and string values for each monitor up to quad screens, for faceplates and displays. Below is my code for the OnChange events for the faceplate trigger and picture trigger. Private Sub pb_FPTrigger_OnChange() If pb_FPTrigger.CurrentValue = True Then If frsIsTerminalServer() Then frsLoadFaceplate "DVSYS." + frsReadValue("DVSYS.DISPLAY_AGENT/" + CStr(frsReadValue("DVSYS.THISUSER/TSNAME.A_CV")) + "/FACEPLATE1.A_CV"), 1 frsWriteValue "0", "DVSYS.DISPLAY_AGENT/" + CStr(frsReadValue("DVSYS.THISUSER/TSNAME.A_CV")) + "/TRIGGER_FP1.F_CV" Else frsLoadFaceplate "DVSYS." + frsReadValue("DVSYS.DISPLAY_AGENT/" + frsGetComputerName + "/FACEPLATE1.A_CV"), 1 frsWriteValue "0", "DVSYS.DISPLAY_AGENT/" + frsGetComputerName + "/TRIGGER_FP1.F_CV" End If End If Exit Sub ErrorHandler: frsHandleError End Sub Private Sub pb_PicTrigger_OnChange() Dim NewPicName As String If pb_PicTrigger.CurrentValue = True Then If frsIsTerminalServer() Then NewPicName = frsReadValue("DVSYS.DISPLAY_AGENT/" + CStr(frsReadValue("DVSYS.THISUSER/TSNAME.A_CV")) + "/MONITOR1.A_CV") frsWriteValue "0", "DVSYS.DISPLAY_AGENT/" + CStr(frsReadValue("DVSYS.THISUSER/TSNAME.A_CV")) + "/TRIGGER_MON1.F_CV" Else NewPicName = frsReadValue("DVSYS.DISPLAY_AGENT/" + frsGetComputerName + "/MONITOR1.A_CV") frsWriteValue "0", "DVSYS.DISPLAY_AGENT/" + frsGetComputerName + "/TRIGGER_MON1.F_CV" End If If Not frsIsPicOpen(NewPicName) Then frsReplacePictureOnScreen NewPicName, 1 End If End If Exit Sub ErrorHandler: frsHandleError End Sub
The animated value is set at runtime so that I didn't have to hard-code the workstation names into the individual toolbars for each workstation/session. The animations are set in the toolbar's CFixPicture_Initialize script upon loading in Operate Run, see excerpt below:
'*** Begin DeltaV Display Agent *** 'Animate the ps_MyPicture variable with the primary monitor parameter for this workstation 'Each worksation should have a corresponding WORKSTATION_DA composite in the DISPLAY_AGENT module Set objTest = frsFindLocObj(Me, "AnimatePicTrigger") If Not objTest Is Nothing Then If frsIsTerminalServer() Then objTest.Source = "DVSYS.DISPLAY_AGENT/" + CStr(frsReadValue("DVSYS.THISUSER/TSNAME.A_CV")) + "/TRIGGER_MON1.B_CV[_NOT_CONFIG_OK_]" Else objTest.Source = "DVSYS.DISPLAY_AGENT/" + frsGetComputerName + "/TRIGGER_MON1.B_CV[_NOT_CONFIG_OK_]" End If End If Set objTest = Nothing Set objTest = frsFindLocObj(Me, "AnimateFPTrigger") If Not objTest Is Nothing Then If frsIsTerminalServer() Then objTest.Source = "DVSYS.DISPLAY_AGENT/" + CStr(frsReadValue("DVSYS.THISUSER/TSNAME.A_CV")) + "/TRIGGER_FP1.B_CV[_NOT_CONFIG_OK_]" Else objTest.Source = "DVSYS.DISPLAY_AGENT/" + frsGetComputerName + "/TRIGGER_FP1.B_CV[_NOT_CONFIG_OK_]" End If End If Set objTest = Nothing '*** End DeltaV Display Agent ***
In reply to petroban:
Andre Dicaire