Home AMX User Forum NetLinx Studio

Control a Device Dialog

Hello all.

Simple frustration here: Message(s) to Send text field and the String Expressions check box.

Perhaps I just don't get it, but I cannot figure out how to format what I want to output. I have read the help page on many occasions, and its explanation leaves me more confused. Probably the easiest way to explain this would be an example. I want to send:

"This is my string" with a 0x03 (CR, $03) on the end.

In Java, a simple concat would work (with a cast for the CR):
"This is my string" + (char) 0x03
or
"This is my string\r" - for the escape sequenc

I have tried:
"'This is my string',$03" with the String Expressions checked
"This is my string",$03 with the String Expressions checked
'This is my string,$03 with the String Expressions not-checked

All seem to fail.

(FYI - Baud and other comm parameters are set correctly and intentionally.)

What is the right answer? Thanks in advance!

Matt

Comments

  • PhreaKPhreaK Posts: 966
    The control/emulate dialogue uses the same syntax for string concatenation as NetLinx.
    "'This is my string',$03"
    is the one you're after.

    If you're having issues check the outgoing strings in diagnostics to make sure you can see it going out. Personally I've stopped using 'control a device' altogether due to its buginess. The telnet command "send s <device>, <string>" works well though.
  • BigsquatchBigsquatch Posts: 216
    Does the device have an oddball protocol? In ASCII a carriage return is $0D.
  • And just to make sure... if it's an external device you should have "message type" selected as string.
  • Jorde_VJorde_V Posts: 393
    Bigsquatch wrote: »
    Does the device have an oddball protocol? In ASCII a carriage return is $0D.

    He says Carriage return so it should always be $0D.
Sign In or Register to comment.