Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Andrew S on April 23, 2019, 03:45:55 PM

Title: Simulator Serial-port not being saved when changed
Post by: Andrew S on April 23, 2019, 03:45:55 PM
Hello. I'm using Designer 2.5.1 on Win10. I have two serial ports on the machine (COM1 and COM4). At startup the simulator selects COM1 but I want to use COM4 so I select it and press OK. The instructions say I have to restart the simulator for that change to be picked up, but when I close and reopen it the selected serial port is back to COM1 and there is no activity on COM4.
I enabled tracing on COM4 and I see activity during the port selection dialog but nothing otherwise.

Am I doing something wrong?
Thanks, Andrew.
Title: Re: Simulator Serial-port not being saved when changed
Post by: BobO on April 23, 2019, 03:56:54 PM
This may be related to a bug in 2.5.1 where the Simulator is pointing to the wrong directory. It may resolve if you manually create "C:\Users\Public\Public Documents\Do-more\Designer2_2\Bin".

DmD 2.5.2 should be dropping tomorrow. It fixes the directory issue.
Title: Re: Simulator Serial-port not being saved when changed
Post by: Andrew S on April 23, 2019, 04:11:49 PM
Thanks Bob. I did see that post. I got some strangeness when I added the folder. I'll update tomorrow and see if it persists after that.
Title: Re: Simulator Serial-port not being saved when changed
Post by: BobO on April 23, 2019, 11:37:46 PM
I need to confirm this, but it?s possible that there is also a command line switch to specify the comm port.
Title: Re: Simulator Serial-port not being saved when changed
Post by: BobO on April 24, 2019, 10:45:08 AM
I was wrong...no command line switch.
Title: Re: Simulator Serial-port not being saved when changed
Post by: Andrew S on April 24, 2019, 03:58:56 PM
Ok. I'll check the 2.5.2 shortly and report back.
Title: Re: Simulator Serial-port not being saved when changed
Post by: Andrew S on April 24, 2019, 04:11:11 PM
Upgraded to 2.5.2. I'm still not getting the COM port saved in the simulator. It continually defaults to the first port in the list.
Title: Re: Simulator Serial-port not being saved when changed
Post by: Andrew S on April 30, 2019, 12:40:54 PM
Hi Bob. Any more thoughts about this issue, which (for me at least) appears to be persisting under DMD 2.5.2?

Thanks, Andrew.
Title: Re: Simulator Serial-port not being saved when changed
Post by: BobO on April 30, 2019, 12:47:44 PM
Hi Bob. Any more thoughts about this issue, which (for me at least) appears to be persisting under DMD 2.5.2?

Thanks, Andrew.

I'm actually looking at it right now. Code that has worked right for 10 years doesn't work anymore. I'm starting to suspect a Windows 10 change or some other MicrosoftGonnaSaveUs thing.

The way it is supposed to work is that we test the last saved comm port on startup, and if it fails, we scan for available ports, automatically selecting the first available. When you pull up the select dialog, is scans for ports and lets you select. When the Sim shuts down, it saves the last selected (auto or manual) to the .STATE file. I changed the mapping of my port and it doesn't open at all now.

When you open the selection dialog, do you see the port?
Title: Re: Simulator Serial-port not being saved when changed
Post by: Andrew S on April 30, 2019, 12:51:35 PM
Yes I do. The port is a USB virtual-serial port (to a Sealink 4101 serial server) which works fine with other software. As you mentioned, I'm on a Win10 machine. Perhaps you're on to something...
Title: Re: Simulator Serial-port not being saved when changed
Post by: BobO on April 30, 2019, 12:59:00 PM
Yes I do. The port is a USB virtual-serial port (to a Sealink 4101 serial server) which works fine with other software. As you mentioned, I'm on a Win10 machine. Perhaps you're on to something...

Then my issue and yours may be different. I'm wondering if they removed support for the old style "COMx" and now require the new and improved "\\.\COMx" device reference.

One other thing you can try: adding a /c to the Sim command line tells it to bypass the port test. If it still fails, my money is on the name format change, since some of the Sim code is using the old and some is using the new.
Title: Re: Simulator Serial-port not being saved when changed
Post by: Controls Guy on April 30, 2019, 05:25:41 PM
If a person is using WinX, do they DESERVE to have their software work as expected?    :D
Title: Re: Simulator Serial-port not being saved when changed
Post by: Mike Nash on April 30, 2019, 06:56:08 PM
If a person is using WinX, do they DESERVE to have their software work as expected?    :D

You meant later than WinXP, right?
Title: Re: Simulator Serial-port not being saved when changed
Post by: Controls Guy on April 30, 2019, 06:59:25 PM
Luddite!  Only MY Win version preference (7) is exactly right!   ;)

(Refer to the driving speed rule -- anyone driving faster than you is a maniac, anyone slower is an idiot)
Title: Re: Simulator Serial-port not being saved when changed
Post by: BobO on April 30, 2019, 10:14:42 PM
Luddite!  Only MY Win version preference (7) is exactly right!   ;)

(Refer to the driving speed rule -- anyone driving faster than you is a maniac, anyone slower is an idiot)

Apparently the older I get the more maniacs there are. Scary. Upside is that there are fewer idiots now.
Title: Re: Simulator Serial-port not being saved when changed
Post by: Andrew S on May 01, 2019, 12:48:26 PM
Still no joy with the sim you sent over. Starting with /c doesn't help it to 'stick' either. Somehow I got it to keep the setting a couple of times (probably by deleting the sim files and allowing it to recreate them). I changed the serial port to a local USB-serial port and the results are the same - can't save the COM port in the sim.

Andrew.
Title: Re: Simulator Serial-port not being saved when changed
Post by: BobO on May 01, 2019, 01:32:36 PM
Still no joy with the sim you sent over. Starting with /c doesn't help it to 'stick' either. Somehow I got it to keep the setting a couple of times (probably by deleting the sim files and allowing it to recreate them). I changed the serial port to a local USB-serial port and the results are the same - can't save the COM port in the sim.

Andrew.

I'm not sure where to go. There really isn't much to this:
1. The serial port field defaults to COM1.
2. On initialization, it reads the .STATE file (if present) and overwrites the default.
3. If the /c flag hasn't been set, it attempts to open the serial port to confirm existence.
   a) If the port does exist, it continues with no changes
   b) If the port doesn't exist, it scans for ports and selects the first one found.
4. When you invoke the selection dialog, it scans for ports and if the currently selected port is in that list, it selects it.
   a) If you choose a port and press OK, it overwrites the serial port field.
   b) If you Cancel, no change.
5. When you shut down, it writes the current serial port field to .STATE.

If the port shows up in the list, it should be written to the .STATE file on shutdown, and should load it on startup.

While testing, when I changed the mapped port (COM1 to COM2 and back) Windows 10 refused to let me open my serial port until I rebooted. It showed up in the device manager correctly, but the port open failed with a not found error.

Title: Re: Simulator Serial-port not being saved when changed
Post by: Andrew S on May 01, 2019, 06:56:04 PM
Is it safe to delete just the .STATE file (with the sim closed) to reset the saved value?
Title: Re: Simulator Serial-port not being saved when changed
Post by: BobO on May 01, 2019, 07:00:08 PM
Is it safe to delete just the .STATE file (with the sim closed) to reset the saved value?

Yes.
Title: Re: Simulator Serial-port not being saved when changed
Post by: Andrew S on May 02, 2019, 01:54:33 PM
Bob, perhaps my issue is related to the dev-version (2.5.1) Sim you sent over. It doesn't appear to write STATE or FLASH files into C:\Users\Public\Public Documents\Do-more\Designer2_5\Bin (whereas the 2.5.0 version does). Is it putting these files elsewhere perhaps?

Andrew.
Title: Re: Simulator Serial-port not being saved when changed
Post by: BobO on May 02, 2019, 02:38:50 PM
Bob, perhaps my issue is related to the dev-version (2.5.1) Sim you sent over. It doesn't appear to write STATE or FLASH files into C:\Users\Public\Public Documents\Do-more\Designer2_5\Bin (whereas the 2.5.0 version does). Is it putting these files elsewhere perhaps?

Andrew.

I'm probably not up to date on another fix. It's probably going to the 2.2 directory.
Title: Re: Simulator Serial-port not being saved when changed
Post by: Andrew S on May 02, 2019, 03:25:07 PM
Yep, that was it. Thanks Bob.
Title: Re: Simulator Serial-port not being saved when changed
Post by: BobO on May 02, 2019, 08:08:52 PM
Yep, that was it. Thanks Bob.

Sorry. I was in the middle of doing some other work and had a few minutes during a lengthy build to look at it. I didn't fetch fresh code from version control, so my local copy lacked some fixes others had done. If it's working for you now (other than the directory), I can get you something better.
Title: Re: Simulator Serial-port not being saved when changed
Post by: Andrew S on May 02, 2019, 08:56:17 PM
Something better would be good.