60
API / VCOM Commands
Appendix
IND100077-132
Basic Example for setting Half/Full Duplex Mode
Example using Microsoft® Visual Studio 2012, C# style.
Note,
COM7
has been used as port ID. It may differ depending on your system installation. In any case, simply write
COM
x
(where
x
is the number defined by the Operating System automatically) for Virtual COM Port.
using
System.IO.Ports;
namespace
CS100031_1_VCOM_Example
{
public partial class
Form1
:
Form
{
private
SerialPort
serialPort;
public
Form1()
{
InitializeComponent();
OpenComPort();
//Opens COM port with Baudrate 9600.
}
public void
OpenComPort()
{
serialPort =
new
SerialPort
(“
COM7
”, 9600,
Parity
.None, 8,
StopBits
.One);
serialPort.
Handshake
= Handshake.None;
serialPort.Open();
}
private void
btnQDUHalf_Click(
object
sender,
EventArgs
e)
//Set Half Duplex
{
byte
[] message =
new byte
[9] { 0x07, 0xFF, 0x51, 0x44, 0x55, 0x01, 0x0E, 0x00, 0xFF };
serialPort.Write(message, 0, message.Length);
}
private void
btnQDUFull_Click(
object
sender,
EventArgs
e)
//Set Full Duplex
{
byte
[] message =
new byte
[9] { 0x07, 0xFF, 0x51, 0x44, 0x55, 0x01, 0x0E, 0xFF, 0x00 };
serialPort.Write(message, 0, message.Length);
}
}
}
Visual Example:
Содержание Hatteland Display HT B22G Series
Страница 6: ...6 This page left intentionally blank...
Страница 7: ...7 General...
Страница 11: ...11 Installation...
Страница 24: ...24 This page left intentionally blank...
Страница 25: ...25 Specifications...
Страница 37: ...37 Technical Drawings...
Страница 39: ...39 Technical Drawings Accessories...
Страница 44: ...44 This page left intentionally blank...
Страница 45: ...45 Appendixes...
Страница 65: ...65 Appendix IND100077 24 User Notes...
Страница 67: ...67 Revision History IND100077 128...
Страница 68: ...www hatteland display com...