Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: MarkTTU on January 12, 2026, 03:04:50 PM

Title: Setting up serial port from ladder
Post by: MarkTTU on January 12, 2026, 03:04:50 PM
I know there's a SETUPSER instruction and it works great, but I'm trying to provide a way for customers to select their comms parameters from the touch screen (c-more) and then implement that in ladder. I know there's not that many combinations (8 baud rates, 2 options each for data bits, stop bits, and parity), but I'm wondering if there's a way to programmatically tell the SETUPSER instruction to use 9600/8/N/1 or 2400/7/E/2 without having to just have 64 separate rungs controlled by a host of input logic.
Title: Re: Setting up serial port from ladder
Post by: BobO on January 12, 2026, 05:32:10 PM
I know there's a SETUPSER instruction and it works great, but I'm trying to provide a way for customers to select their comms parameters from the touch screen (c-more) and then implement that in ladder. I know there's not that many combinations (8 baud rates, 2 options each for data bits, stop bits, and parity), but I'm wondering if there's a way to programmatically tell the SETUPSER instruction to use 9600/8/N/1 or 2400/7/E/2 without having to just have 64 separate rungs controlled by a host of input logic.

There isn't, sorry.
Title: Re: Setting up serial port from ladder
Post by: Mike Nash on January 14, 2026, 09:29:28 AM
DEVWRITE Can write the various settings and you can change each parameter using valid values. See help on the instruction.

I've used it to auto detect the settings for a device I knew what a valid response looked like. Then I used stages to step through various combos that would be valid for the device I was using.

It would be simpler to just put in what a user wanted using six DEVWRITE instructions.
Title: Re: Setting up serial port from ladder
Post by: MarkTTU on January 14, 2026, 12:03:38 PM
Thanks Mike! DEVWRITE looks like it should do the trick. Just have to make sure it re-runs at every power up, but that's not an issue.
Title: Re: Setting up serial port from ladder
Post by: BobO on January 14, 2026, 12:13:03 PM
I had honestly forgotten that we added DEVWRITE access to the port settings. I would have guessed it was DEVREAD only.