Hi I'm looking for a simple example of reading a byte at a time from a serial port. Currently I have a stream of bytes coming in with no return line, so I'm wanting to add that myself. I'll basically need to read each byte, then calculate a checksum and check the next byte if it's a checksum. If it's a checksum then insert a return line, if not I need to keep adding and checking for a valid checksum.
Thanks,
Travis
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2019-06-11
Hello Stefan,
what a nice name. I want use script Communicator to communicate with an handheld device. The used communication gives an echo of each Byte. So I have to send single Bytes. For example:
-> 0x18
<- 0x06
But this are only single Bytes. If I use sendString('0x18'), the terminal sends 30 78 31 38
If I use var Feld = Array(0x18); and sendDataArray(Feld) , the Terminal sends 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
I Just want a single 18.
Thanks,
Stefan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
yes a really nice name :-).
If you use sendString('0x18') then you send the string 0x18 (4 characters). If you create an array with Array(0x18) then you create an empty array with the size of 18 (empty) entries.
If you just want to send a single byte you have to do this:
var data = Array();
data[0] = 0x18;
sendDataArray(data);
Regards,
Stefan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2019-06-12
Hi Stefan,
Thanks a lot!
Regards,
Stefan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2019-06-12
Hi Stefan,
Thanks a lot!
Regards,
Stefan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi I'm looking for a simple example of reading a byte at a time from a serial port. Currently I have a stream of bytes coming in with no return line, so I'm wanting to add that myself. I'll basically need to read each byte, then calculate a checksum and check the next byte if it's a checksum. If it's a checksum then insert a return line, if not I need to keep adding and checking for a valid checksum.
Thanks,
Travis
Hi Travis,
you can find an example script in the attachment.
Regards,
Stefan
Last edit: Stefan Zieker 2019-04-18
Hello,
how is it possible so send one singe byte like 0x06 for <ack> ?</ack>
Thanks,
Stefan
Hi Stefan
what do you exactly mean?
Regards,
Stefan
Hello Stefan,
what a nice name. I want use script Communicator to communicate with an handheld device. The used communication gives an echo of each Byte. So I have to send single Bytes. For example:
-> 0x18
<- 0x06
But this are only single Bytes. If I use sendString('0x18'), the terminal sends 30 78 31 38
If I use var Feld = Array(0x18); and sendDataArray(Feld) , the Terminal sends 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
I Just want a single 18.
Thanks,
Stefan
Hi Stefan
yes a really nice name :-).
If you use sendString('0x18') then you send the string 0x18 (4 characters). If you create an array with Array(0x18) then you create an empty array with the size of 18 (empty) entries.
If you just want to send a single byte you have to do this:
Regards,
Stefan
Hi Stefan,
Thanks a lot!
Regards,
Stefan
Hi Stefan,
Thanks a lot!
Regards,
Stefan