No announcement yet.

Serial Port with Vista

  • Filter
  • Time
  • Show
Clear All
new posts

  • Serial Port with Vista

    I have a program compiled with PB3.0, unfortunately I do not have the source code. It uses the RS232 serial port to control a piece of process equipment. The program has worked on PC's under Win2000 and WinXP. The control PC has now been 'upgraded' to Vista 32bit because this is required for other programs. The control program no longer works - it says the machine is not connected. I have checked that the program is correctly set for the COM# of the serial port.
    Should a program compiled with PB3.0 work with Vista?

  • #2
    You can use it inside a Virtual Machine with any OS you think it's better; if it worked with XP, that may be a good choice.
    There are lots of free alternative around, like VMware, VirtualPC, etc.

    -- The universe tends toward maximum irony. Don't push it.

    File Extension Seeker - Metasearch engine for file extensions / file types
    Online TrID file identifier | TrIDLib - Identify thousands of file formats


    • #3
      >Should a program compiled with PB3.0 work with Vista[/32]?

      To address your question more generally....

      It depends how the program was written.

      If the program was properly written using nothing but the PowerBASIC intrinsics (in your case, the "COMM xxxxx" statements), yes, it should work.

      But if the program was written using third-party-libraries, in-line assembly code or in general "poorly" the answer is "six-five and pick'em."

      Michael Mattias
      Tal Systems (retired)
      Port Washington WI USA
      [email protected]


      • #4
        Look in Control Panel, System, Hardware tab, Device Manager button, Ports, Communications Port, right click COM1, click Properties (or Vista equivilent) and make sure it is enabled.


        • #5
          Thanks for the advice fellas. As far as I can see from the Vista device manager the serial port is working correctly.
          I'm trying to get hold of the source code to debug it, otherwise will have to try the VM idea.


          • #6
            Might want to check error codes too and see if a device is currently using the port. SysInternals/Microsoft has a nice PortMon app to see the port information and any transfers on it. Might check the properties of the port too and make sure they match the settings needed in case they aren't setting them manually in the code.

            And, of course, checking possible 3rd Party Firewalls and such that may block it...
            Mobile Solutions
            Sys Analyst and Development


            • #7
              tell your boss to dump Vista from the process contol PC. It's a completely inappropriate operating system to use for process control. DOS is far better.

              If your boss doesn't understand, which is quite common in bosses, then do all your process control in a single board or embedded computer and tell your boss that's it's a single component which plugs into a PC arther than a PC in its own right. Then do the fancy graphics and printing and internet stuff on the Vista PC.
              Boss is happy that the project works and is under budget and ahead of schedule, you're happy because boss thinks you did well, production line is happy because all the process control keeps running even when the Vista PC crashes or runs slow.

              If your boss does understand, which some do, then tell him the best solution is to ADD a Vista PC to the current system to do whatever it is that Vista is needed for but to leave the rest of the system in place to run things and make sure they work reliably.
              Again, Boss is happy because it's a good solution. You're happy because you solved the problem. Production line is happy because all the process control keeps running even when the Vista PC crashes or runs slow and there's next to no downtime in testing a new system because the critical parts haven't changed.



              • #8
                I don't want to interfere with the Vista system because that's someone else's project. We are a very small business and I don't want to start an argument.
                For the moment I have got round the problem by bringing in another PC using XP to run the old application. A bit of a waste because the program is only run twice a day, but at least it works...


                • #9
                  For the moment I have got round the problem by bringing in another PC using XP to run the old application. A bit of a waste because the program is only run twice a day, but at least it works...
                  That's not weird at all.

                  Most of my services work for clients is done on "limited purpose" machines whose ONLY function is processing EDI (Electronic Data Interchange ) data. That's why I have stuff on Windows/2000 and Windows Server 2003 systems. (at least all the Win/9x are finally gone).

                  Besides, what else are you gonna do with all those older PCs? May as well get some use out of them.
                  Michael Mattias
                  Tal Systems (retired)
                  Port Washington WI USA
                  [email protected]


                  • #10
                    A bit of a waste because the program is only run twice a day, but at least it works...
                    If it works then it's not a waste! Looks like you've solved the problem for next to zero cost instead of spending time and money redesigning things.



                    • #11
                      just to help support what Paul Dixon said.

                      in the pbcc and pbwin manual, and also on the manual in the help section, there is a demo for "a simple communications program".
                      in the remarks at the end of the demo, there was this.

                      Compared to DOS applications, this communications application may seem overly complex. This is because we simply cannot afford to use 100% of the CPU just to monitor a serial port. If we did, your multitasking operating system would suddenly take a huge drop in performance. If you examine the code a little more deeply, you will see it takes advantage of a very handy feature of 32-bit Windows: multi-threading.
                      This communications program consists of two threads in total: (1) the main thread handles the user commands and sending data to the modem; (2) the second thread simply monitors the serial port for receive data. If we used only one single thread in this application, the code would need to share its time between both data reception and transmission, but by using two, we ensure that the CPU is not heavily loaded unnecessarily.
                      Using a second thread in this way effectively splits the application into two (almost) independent sections. The only time these threads need to be aware of each other is when one is writing to the list box control. To handle this, we used a GLOBAL variable to signal when data was being displayed; temporarily "locking" the other thread until the task was complete.
                      For further experimentation, you could split the main thread down even further and create a separate thread just for writing data to the serial port. You could even try replacing the TEXTBOX control with a COMBOBOX so users can scroll back through the most recent "send" strings, providing a simple "history" feature.

                      if you are able to get more things going on one machine, the more power to you. and the less noise you will have around you making for a less stressful environment.
                      but many times it is just better to use a older computer and older operating system and except for space and noise, they are much cheaper to use, even a older laptop maybe just what you need, most are quiet and small.

                      but Sally, if you needed some extra support, i hope this helps too.
                      Last edited by Paul Purvis; 12 Mar 2008, 03:53 PM.
                      p purvis


                      • #12
                        Paul, that's very useful food for thought, thank you.
                        Now that I have the immediate problem sorted, I can think about the best way forward.
                        You are a great bunch of people on here.