Questions on Stack Overflow are expected to relate to programming within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer
1

Do not enter the Hex-Code. You need the ASCII-Code in Decimal.
For example: to write 0xF, you must turn it into decimal (15)
after copy con: com1press 'ALT' (keep it pressed) while you enter the decimal value with three digits ( 015 ), then release 'ALT'.
Continue with the next value, if it is a command with more than one HexNumber.
When finished, press Ctrl-Z.

It may be easyer to use, if you write your "commands" to a textfile, then you can copy them to com1:
for example:

copy linefeed com1:

(I have no serial device to test, but it should work)

I tried it with

copy con bell.txt

Then I entered 007 (= 0x07, which is a Bell), Ctrl-Z. This gives a textfile with lenght = 1 byte

Type bell.txt

will then beep.

EDIT
"1B" is the Code for a so-called "Escape-Sequence" (a multi-byte-command) "70" is the command itself and it needs three parameters (n, p1, p2). So the complete Sequence is 5 bytes long. You will have to replace "n", "p1" and "p2" with proper numbers. You will find those in the manual of your serial device ("1B" is the Code for a so-called "Escape-Sequence" (a multi-byte-command) "70" is the command itself and as you describe it, it needs three parameters (n, p1, p2). So the complete Sequence is 5 bytes long. You will have to replace "n", "p1" and "p2" with proper numbers. You will find those in the manual of your serial device (http://www.cognitivetpg.com/downloads/189-9200250C.pdf), Page 69. P1 and P2 seem to describe the time, the drawer needs to open/cose) N describes which drawer you talk to.

EDIT2
create one file per command. eg. "open1.bin" "close1.bin" etc. Create them as described in my first answer. You should first try with "simple" commands (one-byte-commands) to verify, that this works ok. To execute the commands, send them to com 1 using copy open1.bin com1:. For multibyte commmands create them with copy con: file.txt Enter first value while you keep "alt" pressed, release "alt", press it again and keep it pressed for the second value and so on.

Thank you so much for this! cant tell you how much i appritiate it! you just saved me like 500$ if not more! :D
– user2456377Jun 6 '13 at 23:24

I got 1 more issue that i simply cant understand. im hoping maybe you know what to do with it for an Example i need to enter the following code to the printer to make it open my cash register. 1B 70 n p1 p2. my problem is, i dont understand what n p1 and p2 is.. n seems to be used alot and it seems to be binary, but im not able to figuer out how to put it into the command.
– user2456377Jun 7 '13 at 1:50

edited my answer, as it is too long for a comment.
– StephanJun 7 '13 at 5:49

Thanks alot for this. im still struggeling to understand how i should input this into CMD, is there any chance you could give me an Example on what to put into CMD? i really appritiate your help here, wouldnt have come this far without it.
– user2456377Jun 7 '13 at 10:07