I am trying to convert the script function below from HS2 to HS3. This function is called from other functions within the same module to send IR commands from HSTouch.
In HS2:
I am confused as to the correct HS3 call to UltraGCIR3 that corresponds to these two HS2 commands:
The best I could come up with was:
While that replacement is clean in tenScripting3, I have no idea if the "SendIR" command is a HS3 replacement for the HS2 hspi.SendIrCommand. Can UltraJones or someone that has been there done that provide guidance?
Thanks
Gary
In HS2:
Code:
Public Function SendIR(ByVal pParm As String) As Boolean ' Send the IR Command (via UltraGCIR) Dim strSub As String = ":SendIR " ' Define Subroutine name Dim hspi As Object = hs.Plugin("UltraGCIR") ' Define the UltraGCIR object (& Set) Dim bSuccess As Boolean = hspi.SendIrCommand(strIRHcDv, UCase(pParm)) ' Issue the SendIR command & set return code Try ' Start Try/Catch If bDebug Then hs.WriteLog(strPgm, strSub & "->pParm=" & pParm) ' Write to log If bDebug Or bSuccess <> True Then hs.WriteLog(strPgm, strSub & "->SendIR, " & String.Format("SendIrToDevice() returned {0}", bSuccess.ToString())) ' Write RC to log SendIR = True ' Set Exit RC Catch ex As Exception ' Exception Handling routine hs.WriteLog(strPgm, strSub & "->Execution Exception = " & ex.ToString) ' Log error Message End Try ' End Try/Catch End Function
Code:
Dim hspi As Object = hs.Plugin("UltraGCIR") ' Define the UltraGCIR object (& Set) Dim bSuccess As Boolean = hspi.SendIrCommand(strIRHcDv, UCase(pParm)) ' Issue the SendIR command & set return code
Code:
[FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] bSuccess [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]Boolean[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] = hs.PluginFunction([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]"UltraGCIR3"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2], [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]""[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2], [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]"SendIR"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2], {strIRHcDv, UCase(pParm)}) [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000]' Issue the SendIR command & set return code [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
Thanks
Gary
Comment