SEND_STRING - Default CR?
Does SEND_STRING send a CR at the end of a command that you send to a device, by chance? I currently have all of my commands with the CR specified which I then pass to the device via SEND_STRING. Just want to make sure it's not assumed that the command will do this.
Cheers,
Matthew
Cheers,
Matthew
0
Comments
no, you must send it manually yourself.
it looks like
SEND_STRING dv_My_Serial_port , " 'a command string',$0D,$0A" // $D for <CR> and $A or <LF>
I'm guessing that the device in question does not need a CR terminator in this case and they're just using it to the delimit commands in the queue?
Cheers,
Matthew
Hmmm... it's hard to say without the rest of the code.
I assume that somewhere in the code the variable/constant CR is set to $0D
DEFINE_DEVICE dvTP = 10001:1:1 vdvDevice = 33001:1:0 DEFINE_EVENT BUTTON_EVENT [dvTP,1] { PUSH: { SEND_COMMAND vdvDevice, "'PLAY', $0D" } }On the other end you would have something like this:
DATA_EVENT [vdvDevice] //COMMAND STRINGS RECEIVED FROM UI MODULE OR .AXS MAIN { COMMAND: { sQUEUE="sQUEUE,DATA.TEXT" IF (FIND_STRING(sQUEUE,"$0D",1)) // $0D is the delimiter for this message { sCMD = REMOVE_STRING("sQUEUE","$0D",1) SET_LENGTH_STRING(sCMD, LENGTH_STRING(sCMD) - 1); SEND_STRING dvActualDevice "$21,sCMD" //Re-formats the string being sent to the actual device with $21 as the STX } } }The $0D would act as a delimiter for the module to parse what you sent it which is what it looks like you're seeing in the code you posted. My above code is just a crude example.
--John
Thanks for the help, guys. I know I've had a ton of questions over the last week...just trying to make sure I don't get bitten by any peculiarities.
Cheers,
Matthew
Cheers,
Matthew