none
How can I send the hex value of 0x00 in an ISNMP set command? RRS feed

  • Question

  • I am attempting to configure an SNMP object on a printer that requires the value to be sent as a hex string.  I can send the correct hex string as long as the value is greater than 0 using the ChrB VBScript function.  For example, to send the hex string of "1F", I use ChrB(31) or if I just want to send the hex string of "01", I use ChrB(1).  The problem is that if I need to send the hex string "00", ChrB(0) returns nothing or the Null character instead of "00" as I expected.

    So, I guess I really have two questions.  First, why doesn't ChrB(0) return "00" since it returns the hex value/string for any other decimal value?  Secondly, if the ChrB function is working as intended, then how can send the hex string of "00" in an ISNMP set command?

    Thanks in advance for any help.

    TRB

    Friday, December 6, 2013 4:36 AM

Answers

All replies

  • Are you asking about hex.  Hex is text.

    Study the following to understand what hex means:

    s=""
    For i = 0 To 15
       s = s & Hex(i) & "-"
    Next
    MsgBox s
    MsgBox Hex(31)
    MsgBox Hex(645535)
    MsgBox Hex(0)


    Perhaps you are talking about a binary array.  This is what SNMP usually looks for.  I know of no case that asks for hex.

    The Windows registry allows us to enter binary as hex pairs but the UI is converting them into binary bytes.


    ¯\_(ツ)_/¯


    • Edited by jrv Friday, December 6, 2013 4:52 AM
    Friday, December 6, 2013 4:51 AM
  • Read this - it will explain what ChrB is used for.

    http://support.microsoft.com/kb/145745


    ¯\_(ツ)_/¯

    Friday, December 6, 2013 4:56 AM