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
C#.NET ProgrammingProgramming

Avatar of undefined
Last Comment
ocaccy
SOLUTION
Avatar of unknown_routine
unknown_routine
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of ocaccy
ocaccy
Flag of Japan image

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
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of ocaccy
ocaccy
Flag of Japan image

ASKER

Thank you.
ocaccy
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo