Mixed Ascii Hex and Ascii Command

A plugin that allows for end user development of multiple RS232 device control systems.
snx
New Member
New Member
Posts: 46
Joined: Wed Dec 12, 2007 3:17 pm
Contact:

Mixed Ascii Hex and Ascii Command

Postby snx » Fri Aug 21, 2009 6:52 am

Is there any way of combining Ascii Hex and plain Ascii in a command? For example, my DSC alarm requires a command in which the first 3 sets of numbers are Ascii Hex, and then a checksum supplied as plain Ascii. Using something like \30\30\3090 fails as the checksum number "90" is not being interpreted as ascii. The command also requires 2 terminators (a carriage return and line feed). Can I specify "1310" or can the terminators be called as part of the command?

Thanks

User avatar
Fonceur
Expert
Expert
Posts: 583
Joined: Sun Sep 09, 2007 10:18 am
Contact:

Re: Mixed Ascii Hex and Ascii Command

Postby Fonceur » Fri Aug 21, 2009 8:51 am

That sounds like an odd protocol, you would expect them to want the checksum in hex too... Able to attach or link to the protocol info?
MLComDevice: Control serial/TCP device (ASCII/hex) - MLSchedule: Alternative to MLScheduler
MLBeyondTV and MLSageTV: PVR support - TChanger: Sony BDP-CX7000ES 400 disc Bluray changer
TRadio: Sirius/HD/XM radio - TChart: Chart from variable Wiki

snx
New Member
New Member
Posts: 46
Joined: Wed Dec 12, 2007 3:17 pm
Contact:

Re: Mixed Ascii Hex and Ascii Command

Postby snx » Fri Aug 21, 2009 9:34 am

It is a little strange. See attached PDF for more info.
You do not have the required permissions to view the files attached to this post.

User avatar
Fonceur
Expert
Expert
Posts: 583
Joined: Sun Sep 09, 2007 10:18 am
Contact:

Re: Mixed Ascii Hex and Ascii Command

Postby Fonceur » Fri Aug 21, 2009 10:01 am

Actually, from the table 2.4, everything is sent as ASCII hex anyway... So for you, 30h + 30h + 30h = 90h, then 90 = 39h + 30h, so you would send \30 \30 \30 \39 \30 \0D \0A or such...
MLComDevice: Control serial/TCP device (ASCII/hex) - MLSchedule: Alternative to MLScheduler
MLBeyondTV and MLSageTV: PVR support - TChanger: Sony BDP-CX7000ES 400 disc Bluray changer
TRadio: Sirius/HD/XM radio - TChart: Chart from variable Wiki

snx
New Member
New Member
Posts: 46
Joined: Wed Dec 12, 2007 3:17 pm
Contact:

Re: Mixed Ascii Hex and Ascii Command

Postby snx » Fri Aug 21, 2009 1:22 pm

For some reason that doesn't work. I get no response at all as if the terminator string doesn't go through. Changing the command slightly to \30\30\30\39\30\0d with "10" in the command terminator box comes back with a 501 error - bad checksum. When using a serial test program, I send the command as \30\30\3090\0d\0a and do get a command acknowledgment "500" from the alarm but my test program works with mixed hex & ascii.

User avatar
Fonceur
Expert
Expert
Posts: 583
Joined: Sun Sep 09, 2007 10:18 am
Contact:

Re: Mixed Ascii Hex and Ascii Command

Postby Fonceur » Fri Aug 21, 2009 3:03 pm

Well, according to the doc you are missing the "Data bytes" "partition 1-8", just after the command, but before the checksum...
MLComDevice: Control serial/TCP device (ASCII/hex) - MLSchedule: Alternative to MLScheduler
MLBeyondTV and MLSageTV: PVR support - TChanger: Sony BDP-CX7000ES 400 disc Bluray changer
TRadio: Sirius/HD/XM radio - TChart: Chart from variable Wiki

snx
New Member
New Member
Posts: 46
Joined: Wed Dec 12, 2007 3:17 pm
Contact:

Re: Mixed Ascii Hex and Ascii Command

Postby snx » Fri Aug 21, 2009 3:36 pm

True but the command in question is just a poll (000) with 0 in the data bytes. Using /30 /30 /30 /30 /30 /39 /30 /0d /0a produces the same results- 501 error. I'll keep trying different combinations.

User avatar
Fonceur
Expert
Expert
Posts: 583
Joined: Sun Sep 09, 2007 10:18 am
Contact:

Re: Mixed Ascii Hex and Ascii Command

Postby Fonceur » Fri Aug 21, 2009 6:11 pm

snx wrote:True but the command in question is just a poll (000) with 0 in the data bytes. Using /30 /30 /30 /30 /30 /39 /30 /0d /0a produces the same results- 501 error. I'll keep trying different combinations.

Yes, but now the checksum is 120 = 78h (37h 38h) (it's over the 4 bytes, not just the first 3)... And after rechecking, 3 x 30 = 90 = 5A (35h 41h).
MLComDevice: Control serial/TCP device (ASCII/hex) - MLSchedule: Alternative to MLScheduler
MLBeyondTV and MLSageTV: PVR support - TChanger: Sony BDP-CX7000ES 400 disc Bluray changer
TRadio: Sirius/HD/XM radio - TChart: Chart from variable Wiki

snx
New Member
New Member
Posts: 46
Joined: Wed Dec 12, 2007 3:17 pm
Contact:

Re: Mixed Ascii Hex and Ascii Command

Postby snx » Sat Aug 22, 2009 8:35 am

You are correct. However, still no go. Seems that no matter what combination I send, the alarm does not understand the checksum. Only sending the checksum as pure ascii gets a command acknowledgment (500). (See attached screenshots) I ran the commands in SimpleTerm Gold just to rule out the possibility of MLGenericDevice being the problem. DSC-Poll4.jpg is a successful poll command.

I do own a copy of MLComDevice as well. Does your plugin allow sending is this format?
You do not have the required permissions to view the files attached to this post.

User avatar
Fonceur
Expert
Expert
Posts: 583
Joined: Sun Sep 09, 2007 10:18 am
Contact:

Re: Mixed Ascii Hex and Ascii Command

Postby Fonceur » Sat Aug 22, 2009 11:13 am

snx wrote:I do own a copy of MLComDevice as well. Does your plugin allow sending is this format?

I just added support for it, with 3 examples, so go grab version 1.3.0 and post on the Tallus forums how it goes...
MLComDevice: Control serial/TCP device (ASCII/hex) - MLSchedule: Alternative to MLScheduler
MLBeyondTV and MLSageTV: PVR support - TChanger: Sony BDP-CX7000ES 400 disc Bluray changer
TRadio: Sirius/HD/XM radio - TChart: Chart from variable Wiki

snx
New Member
New Member
Posts: 46
Joined: Wed Dec 12, 2007 3:17 pm
Contact:

Re: Mixed Ascii Hex and Ascii Command

Postby snx » Sat Aug 22, 2009 5:12 pm

You are the best!

Will test it out later.


Return to “MLGenericDevice”

Who is online

Users browsing this forum: No registered users and 1 guest