Ports Swapped

MSM Mill mode support
Post Reply
tmostad
Posts: 14
Joined: Tue Oct 29, 2013 2:14 pm

Ports Swapped

Post by tmostad »

I have a system with two PCI add-in parallel port cards located at 0xd010 and 0xd070 (respectively) connected to my Tormach PCNC 100 Series III. Each card alone can run the mill when I set it to Port 1 so I know that Mach talks to them without problems.

One problem is immediately obvious however, on the Hardware screen they are swapped. Mach is setup to run everything off of Port 1 yet all of those signals show up on MSM Hardware Screen Port 2. The charge pump is obvious since it flashes continuously. So then I tried connecting the Mist to Output#2 and assigned Output#2 to Port 2 Pin 1. When I turn on the Mist output sure enough Port 1 Pin 1 lights on the Hardware screen. However, no matter what I do, nothing is actually read or written to the Port 2 parallel port (which shows as Port 1 on the hardware screen). I suspect that if I could figure out why the ports appear swapped in MSM, maybe the other problem would solve itself. Any ideas or things to try?
User avatar
DaveCVI
Site Admin
Posts: 798
Joined: Mon Feb 04, 2013 3:15 pm
Contact:

Re: Ports Swapped

Post by DaveCVI »

HI,
tmostad wrote:I have a system with two PCI add-in parallel port cards located at 0xd010 and 0xd070 (respectively) connected to my Tormach PCNC 100 Series III. Each card alone can run the mill when I set it to Port 1 so I know that Mach talks to them without problems.

One problem is immediately obvious however, on the Hardware screen they are swapped. Mach is setup to run everything off of Port 1 yet all of those signals show up on MSM Hardware Screen Port 2. The charge pump is obvious since it flashes continuously. So then I tried connecting the Mist to Output#2 and assigned Output#2 to Port 2 Pin 1. When I turn on the Mist output sure enough Port 1 Pin 1 lights on the Hardware screen. However, no matter what I do, nothing is actually read or written to the Port 2 parallel port (which shows as Port 1 on the hardware screen). I suspect that if I could figure out why the ports appear swapped in MSM, maybe the other problem would solve itself. Any ideas or things to try?
Thought 1:
I'm wondering if there is a terminology issue at play here...
I think of the "port 1" and "port 2" terms as referring to the ports via the addresses input on the mach config menu, ports & Pins page.
Sometimes (more often in the non-mach world) parallel ports are referred to as LPT1 and LPT2 - these terms mean the windows view pf the parallel ports.
It is possible with PCI cards for Window's LPT1 to be Mach's Port 2 and vise versa. To avoid any of that complication, I am going to use only the port 1 and port 2 terms as mach uses them. This will let us remove the possibility that one of us is talking using mach terms while the other is using windows terminology.

Thought 2:
In the Mach ports& Pins dialog box, Port setup and Axis selection tab, there are two boxed areas where you input the address for the parallel port. The left one is for port 1 and the right one is for port 2. The port 2 box also has a check box for "pins 2-9 as inputs" that the port 1 box does not have.

I'm confident that the port1 address from the ports&pins dialog is used for the port 1 section of the MSM hardware page and that the port 2 address is used for the port 2 section of the page. These use use a very low level interface - the background code literally takes the physical port address from ports&Pins dialog and read/writes from that physical PC address to get the bits to show on the MSM hardware page.

The only thing I can think of at the moment is that the addresses may be reversed from what you think they are between these boxes on the ports & pins page.
Please double check the port addresses.

Dave
Productivity Software for Personal CNC Machinists
http://www.CalypsoVentures.com
tmostad
Posts: 14
Joined: Tue Oct 29, 2013 2:14 pm

Re: Ports Swapped

Post by tmostad »

Thanks for the response Dave.

Are you saying that when MSM refers to Port 1 or Port 2, it means LPT1 or LPT2 respectively? Mach refers to ports by their addresses and really doesn't care whether they are LPT 1 or 2. I tried switching addresses in Mach and that made no difference. I have not tried to swap the LPT1/LPT2 definitions in Windows Device Manager but will give that a try. Thanks again,

Tim.
User avatar
DaveCVI
Site Admin
Posts: 798
Joined: Mon Feb 04, 2013 3:15 pm
Contact:

Re: Ports Swapped

Post by DaveCVI »

Hi Tim,
tmostad wrote:Thanks for the response Dave.

Are you saying that when MSM refers to Port 1 or Port 2, it means LPT1 or LPT2 respectively?
Nope, just the opposite. MSM only knows about mach port numbers. MSM actually does not have any knowledge of windows concepts of LPT#s.

I suggest trying to simplify the situation for testing. Disable port 2 in mach. restart mach & MSM. now look at the hardware PPdriver page - all the port 2 pin leds will be off (as there is only port 1 enabled).

Does port1 by itself act as you expect?

Are you using two separate PCI cards or one PCI card with two P-ports on it?

How are you determining what hex address is which physical output cable from the PCI cards?

Dave
Productivity Software for Personal CNC Machinists
http://www.CalypsoVentures.com
tmostad
Posts: 14
Joined: Tue Oct 29, 2013 2:14 pm

Re: Ports Swapped

Post by tmostad »

Mystery solved. I didn't realize that I has to exit and restart MSM for the port naming change to take effect. I hit the "Apply" button in Mach's port config screen and nothing changed when I got back to do some more testing and restarted the system, the port were named correctly. It was indeed that the ports had been swapped in Mach's config screen. All is well now (except I still can't get Port 2 to output anything but that appears to be a BoB problem). Thanks for your help!
User avatar
DaveCVI
Site Admin
Posts: 798
Joined: Mon Feb 04, 2013 3:15 pm
Contact:

Re: Ports Swapped

Post by DaveCVI »

HI,
Great!
Sorry, I should have mentioned that MSM only gets the port #s at start up.
That will apply to lots of mach settings - the reason is that when you change a mach setting, it can become active internal to mach, but there is no way for mach scripts (which MSM is written in) to learn there is a new value. Mach writes the new settings to the mach profile (XML) file only when mach exits. MSM can look at the profile info to get the settings (which it does at start up) - but this all means that it often takes a restart cycle for new mach settings to become visible to MSM.

Dave
Productivity Software for Personal CNC Machinists
http://www.CalypsoVentures.com
Post Reply