Here's the code to generate ASCII stuffed integers:
Public Sub Convert_KeySeries()
'PanelView wants a DINT array
Dim K_Series(12) As Integer
'initialize values = 0
For i = 0 To Key_Series.Length
K_Series(i) = 0
Next
' pack Key Series digits into DINT as ASCII characters
For i = 0 To Key_Series.Length - 1
K_Series(i) = Asc(Key_Series.Substring(i, 1))
K_Series(i) = K_Series(i) << ((3 - i Mod 4) *
Next
Print_Code(1) = K_Series(0) Or K_Series(1) Or K_Series(2) Or K_Series(3)
Print_Code(2) = K_Series(4) Or K_Series(5) Or K_Series(6) Or K_Series(7)
Print_Code(3) = K_Series(
Or K_Series(9) Or K_Series(10) Or K_Series(11)
ConvertPrintCodeToHex()
End Sub
Public Sub ConvertPrintCodeToHex()
Try
Dim hi As String
Dim lo As String
hi = Hex(Print_Code(1) Mod 2 ^ 16)
lo = Hex(Print_Code(1) / (2 ^ 16))
Print_Code_Hex(1) = hi & lo
hi = Hex(Print_Code(2) Mod 2 ^ 16)
lo = Hex(Print_Code(2) / (2 ^ 16))
Print_Code_Hex(2) = hi & lo
hi = Hex(Print_Code(3) Mod 2 ^ 16)
lo = Hex(Print_Code(3) / (2 ^ 16))
Print_Code_Hex(3) = hi & lo
Catch ex As Exception
Print_Code_Hex(1) = "FFFFFFFF"
Print_Code_Hex(2) = "FFFFFFFF"
Print_Code_Hex(3) = "FFFFFFFF"
'MsgBox("Convert Print Code to hex: " & vbCrLf & ex.Message)
End Try
End Sub