Shop OBEX P1 Docs P2 Docs Learn Events
Serial Communication in a DOS environment — Parallax Forums

Serial Communication in a DOS environment

UnsoundcodeUnsoundcode Posts: 1,532
edited 2009-02-11 23:07 in Propeller 1
I need a DOS based program on a PC that will run indepedently of the operating system and exchange a few files·via a Propeller. I am thinking it can be done in C and If so I think I could handle that ,·although I have neve done anything serial with C before. It's going to be a one off project so I don't want to go into expensive software. If anyone has done this or has ideas on how best it can be done I would appreciate it. BTW the target PC has Win 95 as the OS if that might make a difference.

Jeff T.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-02-10 20:03
    Jeff, what baud rate do you need? A few of us old-school programmers seem to have PDS or QB4.5 laying around, but it was limited to 9600 bps on COM1-4 only. But both create stand-alone EXE files.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • LeonLeon Posts: 7,620
    edited 2009-02-10 20:21
    There are comms libraries for the DJGPP port of gcc, that run under DOS.

    eon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • Carl HayesCarl Hayes Posts: 841
    edited 2009-02-11 01:20
    Unsoundcode said...
    I need a DOS based program on a PC that will run indepedently of the operating system
    Not sure what exactly you want.· DOS is an operating system, and if it is "DOS-based" it cannot run "independly of the operating system".

    There are many old DOS-based communications programs that run under DOS.· Some of these are in the public domain, and others have always been freeware.· Contact me offline -- I probably have at least one lying around·that can exchange files, emulate dumb terminals, and so forth.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • TubularTubular Posts: 4,699
    edited 2009-02-11 03:55
    Hi Jeff,

    I might be able to help. I support an industrial prop product which logs data to legacy DOS program and accepts commands over the serial link.

    The DOS program is written in Microsoft PDS basic which supports COM1 and COM2 (only) at up to 19,200 bps. We compile using a Tera tech library if we need more ports or higher baud rates etc. I haven't tried it under Win95 or Win98 but can do so if you tell me a bit more about what you're trying to achieve.

    Sometime soon I will need to write a DOS program to load the Propeller EEPROM using the ratiometric protocol (so we can do remote flash upgrades of the Prop application)

    tubular.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2009-02-11 05:12
    It's been a long time, but it seems like I remember a command line option using the MS-DOS "MODE" command to set the COMport, and the MS-DOS "CTTY" command to redirect the standard input/output to the COMport.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-02-11 15:45
    Well that's two of us now that mentioned PDS...I still occasionally run some of my old PDS programs and the do run fairly well under a DOS shell from Windows 95/98. On Windows XP they seem to slow the system down, but its DOS mode is emulated so I expect that. Nontheless 2 of the programs are for serial communication. In 1994 my business BBS was written using QB45. But I am veering off topic.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2009-02-11 16:19
    Hi , thanks for the replies and suggestions, searching PDS and DJGPP brought up a bunch of great material. Sorry about my confusion with operating systems Carl appreciate your offer of help.

    What I want is really very simple , I want to use a Prop for learning experience no matter how simple and hopefully have something practical come out of it. There are 5 identical machines that are PC GUI with PLC control. The GUI loads each time the system is booted , its a DOS·program that only runs on Win95·. The PC is pretty much a bare bones thing·and the only media apart from the HD is a floppy. You can backup and restore from the GUI via the floppy but this has been troublesome ,·corrupt floppies people with out of date copies etc. I was looking into the possibility of restoring/backing up to another kind of media like a flash drive using a serial link , that option being given when the machine is first booted. Speed is not critical but the faster the better , the total cfg files (30) amount to 2.5 Mbyte though only 0.5 Mbyte (9 files)· are critical to the machine running , the cfg files are different for each machine. If this is doable then the most recent versions could be kept in a shared folder on the server for maintenance/engineering ·access.

    comments on feasibility welcome.

    Jeff T.
  • TubularTubular Posts: 4,699
    edited 2009-02-11 20:12
    Hi Jeff

    The simple solution would probably be to clean the floppy drive heads using an isopropyl alcohol head cleaner, or invest in some Iomega Zip drives (cheap and bountiful on ebay, internal or external via parallel port, 100 Mb or more, drivers available for dos/win95/beyond)

    However that wouldn't be "The Propeller Way" and I fully understand your burning desire to apply the Prop to such problems.

    Are the CFG files are text based (can you 'Type' them to the dos screen and read them)? Because if they are, and terminated with a Control-Z EOF character, it may be possible to do as Chris suggests and use the dos console to do some of the work for you:-
    MODE COM1:19200,n,8,1
    COPY PLC.CFG COM1

    You'd still need a mechanism to 'set' the filename to write to, and a restore mechanism.
    I fear serial transfer speed might make this painfully slow (0.5Mbyte at 19200 is over 4 minutes). You could write a transfer utility to go at 115200, or maybe look at using the parallel port if it is present.

    Out of interest what PLC are they using? If it talks Modbus or some other simple protocol you may be able to offer other SCADA / GUI features via the Prop

    tubular
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2009-02-11 22:02
    Thanks Tubular, that puts things clearly in perspective. You are absolutely right about the Prop and the burning desire, I have never been a patient person.

    I am not against alternatives but really do want to get away from the floppy , apart from these machines the only other floppy drives are 4 or 5 externals that various people have for their own use. Out of several hundred PLC's / remote IO there are perhaps 10% not on the network and 3% not Allen Bradley these machines fall into both catergories , the PLC's are Bekhoff and I know very little about them , they·seem·reliable no qualms about that but there is nothing to spare without adding racks.

    The config files are not all text files unfortunately.

    Anyway just wanted to throw this out for comments , I will still test a few ideas along the same vien to see how good it gets .

    once again thank you all for your comments

    Jeff T.
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2009-02-11 23:07
    Possibly make a small Memory Resident Program or TSR, that boots with the autoexec.bat and or config.sys files.

    It will load into the rams upper memory. You could use Quick Basic or Edit, as they are·both on your computer. I am fairly certain all they need to be is a .bat file. Through the·.bat file you should be able to access any com·or parallel ports, an ISA card and read from memory or·write·to a file as a txt or·dat file. And it should be a fairly simple program, that you may be able to activate with a keyboard interrupt or some other way.

    bill
Sign In or Register to comment.