Home AMX User Forum NetLinx Studio

Why SEND_STRING not work

i not understand
If i send
send_string dvZpre1,"'W 1 1 1',13"
it work

but if i send
send_string dvZpre1,"'$57,$20,$31,$20,$31,$20,$31',13"
it not work

This string write in Parasound ZPre manual

Comments

  • Ascii / Hex

    send_string dvZpre1,"'W 1 1 1',13" :

    'W 1 1 1' thats an ASCII String
    ,13 thats an CR in DEC

    send_string dvZpre1,"'$57,$20,$31,$20,$31,$20,$31',13" :

    '$57,$20,$31,$20,$31,$20,$31' thats a HEX Command as an ASCII String...
    try without ' ' (Highcomma)
    i think thats should be work !
    send_string dvZpre1,"$57,$20,$31,$20,$31,$20,$31,13"
  • Ok
    it work
  • I have some problem with
    DEFINE_CALL 'SWT_KRAMER' (INPUT,OUTPUT)
    {
    IF ((INPUT >= 0) AND (INPUT <= 8) AND (OUTPUT >= 0) AND (OUTPUT <= 8))
    {
    SEND_STRING dvKramer,"$01,'$',ITOA(INPUT + 80),'$',ITOA(OUTPUT + 80),$81,$0D"
    }
    }

    What i do wrong ?
  • ablesimov wrote:
    I have some problem with
    DEFINE_CALL 'SWT_KRAMER' (INPUT,OUTPUT)
    {
    IF ((INPUT >= 0) AND (INPUT <= 8) AND (OUTPUT >= 0) AND (OUTPUT <= 8))
    {
    SEND_STRING dvKramer,"$01,'$',ITOA(INPUT + 80),'$',ITOA(OUTPUT + 80),$81,$0D"
    }
    }

    What i do wrong ?

    You need $80 not 80
  • No - its not work
    SEND_STRING dvKramer,"$01,ITOA(INPUT + $80),ITOA(OUTPUT + $80),$81,$0D"

    Results Line
    13 :: String To [5001:1:1]-[$01129129$81$0D] - 01:46:21
  • I want send

    String To [5001:1:1]-[$01$81$81$81$0D]
  • mpullinmpullin Posts: 949
    I'm confused. You do know that $ is not the actual ascii character '$' right? the $ is just a sigil that signifies the following two numbers refer to a hexadecimal number. For instance $FF = 255.

    Oh and you're converting your additions to ASCII with ITOA(). You don't want ACSII characters. You want numbers. Try this: SEND_STRING dvKramer,"$01,(INPUT + $80),(OUTPUT + $80),$81,$0D"
  • OOO
    Thanks
  • banobano Posts: 173
    This one works for me,but it does create this compiler warning:

    C10573: String used as a CHAR value in a math operation


    send_string dvvidswitch,"$01,(80+itohex(input)),(80+itohex(output)),$81"
  • mpullinmpullin Posts: 949
    itohex() produces a 2+ character string with ascii characters representing a value. For instance itohex(255) = 'FF', itohex(256) = '100', etc.

    it's useful for protocols which demand ascii characters representing hex strings. But if you're just trying to send hex stay away from this function.

    send_string dvvidswitch,"$01,($80+input),($80+output),$81" // I think this is what you're trying to do?
Sign In or Register to comment.