• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 

LPT comp no longer works after upgrade to 9.19?

Started by chedges, June 30, 2011, 09:50:59 am

Previous topic - Next topic

chedges

Hi,

I'm hoping you can help me with a problem with the 9.19 release (trial) after upgrading from the 8.22 version (Pro).

I'm using the TnrLPT component to send data to a thermal printer and this works perfectly in the 8.22 release.
I have found some issues when running on a x64 windows install so I have installed the 9.19 trial release to see if this
resolves the problem.

I am finding that if I use the 9.19 release on my 32bit Win7 machine, I can no longer print to the printer (no errors and no printed output).
I can switch the components back to the 8.22 release and everything works again.

I need x64 support so I need the 9.19 release but is just doesnt seem to work?

Do you have any suggestions of what to try or what may have changed between 8.22 and 9.19?

Thanks,

Chris Hedges
Tickets.com UK

D2007, NrCommLib 8.22 -> 9.19

Roman Novgorodov

Hello

Thank you for your interest in our product.

We need more details about your problem.

Did you try LPTDemo from latest release of nrComm Lib with your device?
Does it work correctly?
Do you see any exceptions?
Do you use administration account for run application?

Possible your system need small cleanup of 8.xx version.
You can try to delete following registry key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\nrusb
reboot PC and try again.

We tested LPT solution on x64 Win7. All works fine.

Roman Novgorodov
DeepSoftware LLC
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

chedges

July 01, 2011, 07:42:21 am #2 Last Edit: July 01, 2011, 07:44:30 am by chedges
Hi Roman,

I've managed to get 9.19 to work in Win 32bit now, so some progress!

Unfortunately when I try the same test on a Win 7 64bit machine I get the following error

"LPT1 Open is Failed - The system cannot find the file specified"

The 64bit machine is using the same printer and the base address of the port is the same as the 32bit machine.
I've checked the 64bit machines registry for the key you mentioned but it doesn't exist.

Running as administrator does not help either

The code I am using is very simple, see below.

      fLPT1.LptPortNo := 1;
      fLPT1.LptIOBase := StrToInt('$' + edtPortBaseAddr.Text);
      fLPT1.Active := True;
      fLPT1.SendString(Ticket);

Any suggestions?

Thanks,

Chris.


Roman Novgorodov

Hello

Possible TnrLpt can not find LPT port on x64 pc.

Please download compiled LPTDemo from our site and run it on your x64 test machine.

Does it show correct list of LPT ports?
Try to click open needed port. Does it show same exception?
Please try to find LOG file after LPTDemo test and upload it here.

Roman Novgorodov
DeepSoftware LLC
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

chedges

Hi Again,

I've tested the LPTDemo on the 64bit machine and it appears to work ok, no errors were displayed and I was able to activate the port.

Does the LPT demo use a different control to the TnrLPT?

[01/07/2011 12:03:08] nrComm Lib v9.17 Pro  (TRIAL! Please register!) Windows 7 [6.1.7601] Service Pack 1
[01/07/2011 12:03:08] TnrLptDriver Open()
[01/07/2011 12:03:08] TnrLptDriver CreateService ...
[01/07/2011 12:03:09] TnrLptDriver WOW64 mode ...
[01/07/2011 12:03:09] TnrLptDriver x64 stub finished. Error Code : 00000000
[01/07/2011 12:03:09] TnrLptDriver StartService ...
[01/07/2011 12:03:09] TnrLPTDirect mode. Base address: 378

Roman Novgorodov

Hello

You can take a look at LPTDemo sources in Demos folder of nrComm Lic home directory on your hard drive.
You can modify its sources and add code with string output and test again.

Also you can check that nrLpt1.DirectMode := true;

Roman Novgorodov
DeepSoftware LLC
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

chedges

July 05, 2011, 09:53:40 am #6 Last Edit: July 05, 2011, 09:56:45 am by chedges
Hi Roman,

I'm still having issues with printing when using the 9.19 build. I've previously tried your LPT demo on the 64bit machine and that seems to activate the port ok.

I've now tried send some data to the LPT port using my appication rebuilt with 9.19 and it cannot print :( I have ensured the the nrLPT.DirectMode = True
but I cannot get it to work. I do not get any errors raised on my 32bit Win7 machine. If I recompile again with 8.22, it works fine and the printer can print successfully.

As far as I can tell, the LPT port pins are being set differently by the two different versions. I have a small routine to check the LPT pins and to determine if a LPT cable is attached

e.g

function TForm1.LPTDeviceDisconnected : Boolean;
begin
Result := False;

  with fLPT1 do
  begin
    if (not(Pins[pnSelect]) and   //13
        not(Pins[pnNoPaper]) and  //12
            Pins[pnBusy] and      //11
        not(Pins[pnNACK]){ and     //10
            Pins[pnError]} ) then  //15
    begin
    //No Power
      Result := True;
      WriteLog('No Power');
    end
    else
    if (    Pins[pnSelect] and   //13
            Pins[pnNoPaper] and  //12
        not (Pins[pnBusy]) and   //11
            Pins[pnNACK] and     //10
            Pins[pnError]) then  //15
    begin
      //No Cable
      Result := True;
      WriteLog('No Cable');
    end;
  end;

  if Result then
    WriteLog('LPT Printer is disconnected!')
  else
    WriteLog('LPT Printer is connected!');
end;


In 8.22, the above code will correctly indicate that the cable is connected and the printer will print. Switching over to 9.19, the code always reports the cable as disconnected (regardless if the cable is attached or not) and the printer does not print when I send data to it using the LPT.SendString command.

Is there anything I can provide you with that will assist in resolving this issue? I need to get this resolved before I can concentrate on the x64 issues and purchase the 9.19 upgrade.

Many thanks,

Chris.

Roman Novgorodov

Hello

Please run LPTDemo, open port and click <Refresh>.
Does demo show correct states of pins?

Roman Novgorodov
DeepSoftware LLC
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

chedges

Hi Roman,

I've performed the test using the pre-compiled version of the LPTDemo I downloaded from your site and a version compiled using 8.22

The image on the left is the 8.22 version. The test was using the same machine and the same printer. you can see the pins are
different between the two versions (Pins 11 and 12 are different)

Any reason why this should be?





Roman Novgorodov

July 08, 2011, 02:45:17 am #9 Last Edit: July 08, 2011, 02:47:46 am by Roman Novgorodov
Hello

Thank you for information.

Please try new version of LPTDemo from attachment.

Roman Novgorodov
DeepSoftware LLC
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

chedges

Hi Roman,

It's getting there! I can now print successfully using your new excutable on my 32bit Win7 machine! :)
Unfortunately, it does not work on my 64bit machine :(

Here is a screenshot and the log from the 64bit machine. I get no errors, just nothing happens.






[08/07/2011 09:39:11] nrComm Lib v9.20 Pro  (TRIAL! Please register!) Windows 7 [6.1.7601] Service Pack 1
[08/07/2011 09:39:11] TnrLptDriver Open()
[08/07/2011 09:39:11] TnrLptDriver CreateService ...
[08/07/2011 09:39:11] TnrLptDriver WOW64 mode ...
[08/07/2011 09:39:12] TnrLptDriver x64 stub finished. Error Code : 00000000
[08/07/2011 09:39:12] TnrLptDriver StartService ...
[08/07/2011 09:39:12] TnrLPTDirect mode. Base address: 378
[08/07/2011 09:39:22] TnrLPTTry to send string hello<p> ...

Roman Novgorodov

Hello

Thank you for quick feedback.

We tested with x64.  Demo changes and gets LPT pins correctly.

Please try new one from attachment. Click new button "Send string2"

Roman Novgorodov
DeepSoftware LLC
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

chedges

Hi Roman,


Good news, the new button seems to work both on 32 and 64bit versions :)

Can you make available a full nrComm trial version available so I can test it within my code?

Thanks so much for your time and assistance!

Chris.

Roman Novgorodov

Hello

nrComm Lib v9.20 trial is available in ZIP file on main product page.

Roman Novgorodov
DeepSoftware LLC
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

chedges

July 13, 2011, 08:24:43 am #14 Last Edit: July 13, 2011, 08:33:33 am by chedges
Hi Roman,

The version seems to work ok.

I've now purchased the pro version of nrComm but the Share-it! link that got emailed to me only has the 9.19 release.

Can you make the full 9.20 version available?  I can send you any licence information that you may need

Thanks,

Christaan Hedges
Tickets.com Ltd