Serial dtr=True?

“I am currently working on serial communication to connect with a hardware device.
However, the hardware requires the use of the DTR (Data Terminal Ready) function, and the program that utilizes this function works correctly.
However, in Xojo, even when I set mySerial.DTR=True , it doesn’t seem to work.
I would like to know a solution to this issue.”

@jonathan_yun This thread is a duplicate of DTR not working in serial communication - Targets / Windows - Xojo Programming Forum

Please submit your question only once, if not you will get replies on two threads and later on folks will have a hard time looking for the solutionto this problem.

Thanks

I have tried restarting the program and even experimented with placing the setting in the initialization phase, but it didn’t work.
It only seems to function correctly in programs where DTR is already operational.

Myserial.dtr = true
Myserial.reset // or myserial.open
// you need to activate the settings trough open or reset

What kind of interface are you using - USB-serial converter or old-school RS-232 built into the PC? If USB, what chipset does it contain?

If you need an alternative, please try SerialPortMBS class.

I tried what you suggested, but it didn’t work.

This doesn’t seem to be a chipset issue.
It’s working fine with other communication programs.
I suspect it might be a program-related issue.
All programs that use DTR are functioning correctly.
I’m wondering how to activate DTR in Xojo.

The SerialPortMBS class library also did not work.

I am using USB to Serial.

Did some driver software come with this? Did you install it? Better still, did you go to the chipset manufacturer’s website and download/install the latest driver for that chipset?

When I bought one of these more than 10 years ago, I binned the tiny CD with drivers on it, and downloaded the latest macOS driver from the manufacturer’s site. Worked a dream after thet.

It seems unrelated to the device driver because programs with DTR functionality communicate properly.
However, in XOJO, it is confirmed that no communication occurs regarding DTR.
If it were a driver issue, I would expect communication to fail in other programs as well.

There is some xojo made serial port app i used to test. I forgot the name.

MySerial1.DataTerminalReady=True
MySerial1.Reset

Not sure if that will help, it asserts DTR (whereas the docs say the .DTR property turns on DTR flow control, which I’ve never seen used by anything (RTS/CTS yes but not DTR/DSR). Anyway I know that setting .DataTerminalReady property to True or False will in fact turn on and off the DTR line. I’m using a GM-FTDI2-LED-C (Gearmo) USB-RS-232 adapter in Windows 11 under VMWare Fusion and compiled using Xojo 2023R4.

1 Like

Thank u