Hex00 über RS232

Gast #362897
Lesenswert?
• ▲
▼
Print binary content of a variable to the serial port.


Syntax
PRINTBIN var [ ; varn]
PRINTBIN #channel, var [; varn]


Remarks

Var  The variable which value is send to the serial port.
varn  Optional variables to send.
The channel is optional and for use with OPEN and CLOSE statements.

PRINTBIN is equivalent to PRINT CHR(var);
When you use a Long for example, 4 bytes are printed.

Multiple variables may be sent. They must be separated by the ; sign.

The number of bytes to send can be specified by an additional numeric
parameter. This is convenient when sending the content of an array.

Printbin ar(1) ; 3 ' will send 3 bytes from array ar().

Printbin ar(1) ; 2 ; ar(2) ; 4  ' will send 2 bytes from array ar()
starting at index 1, then 4 bytes from array ar() starting at index 4.

When you use Printbin ar(1)  , the whole array will be printed.
When you need to print the content of a big array(array with more then
255 elements) you need to use the CONFIG PRINTBIN option.


See also
INPUTBIN , CONFIG PRINTBIN

Antwort schreiben

Hinweis: der ursprüngliche Beitrag ist mehr als 6 Monate alt. Bitte hier nur auf die ursprüngliche Frage antworten, für neue Fragen einen neuen Beitrag erstellen.

Formatierung
  • [c]C-Code[/c]
  • [code]Code in anderen Sprachen, ASCII-Zeichnungen[/code]
  • [math]Formel in LaTeX-Syntax[/math]
  • [[Titel]] – Link zu einem Artikel
  • Verweis auf einen anderen Beitrag: Rechtsklick auf dessen Beitrags-ID (#8078628), „Adresse kopieren“, in den Text einfügen

Mehr zur Formatierung

Längeren Sourcecode als Anhang, nicht in den Text. JPG nur für Fotos und Scans; Zeichnungen und Screenshots als PNG oder GIF. Siehe Bildformate.

Schon registriert? Anmelden

Wird nicht angezeigt. Wir schicken dir einen Link; sobald du damit bestätigst, erscheint dein Beitrag.

Mit dem Abschicken legst du einen kostenlosen Account an und erkennst die Nutzungsbedingungen und die Datenschutzerklärung an.