Link to home
Start Free TrialLog in
Avatar of ocaccy
ocaccyFlag for Japan

asked on

C# - Send ENQ, CR, LF to COM Port

Hello everybody.

Using this environment:
Windows, C#, Conveter USB/RS485.

How to send ENQ, ID, CR, LF to COM PORT using C#?

Thank's in advance,
ocaccy
SOLUTION
Avatar of unknown_routine
unknown_routine
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ocaccy

ASKER

Thank you.
I'm using C# with System.IO.Ports.
The manual device, tells us that we need to send this sequence, but without citing the language.
[ENQ, 3, 0, CR, LF]

[enquiry, ID, CR, LF] // "3,0" is the ID of device "30"

I use the code below and works with others devices.
 private void timer1_Tick(object sender, EventArgs e)
        {
                string ID = "30";
                CommPort com = CommPort.Instance;
                ID = ConvertEscapeSequences(ID);
                com.Send(ID);
        }

Open in new window

Thanks in advance,
ocaccy
ASKER CERTIFIED SOLUTION
Avatar of Cong Minh Vo
Cong Minh Vo
Flag of Viet Nam image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ocaccy

ASKER

Thank you.
ocaccy