I am tryng to open a cash drawer from within navision. It is attached to the Workstation via a generic Receipt Printer. I was told that If I sent a (BEL) or CTRL+G code to the printer that it would work, but how do I do this. I heard something about escape codes, how does this do it for me? Cheers Darren Bezzant, NCPS, NCSD Central Software Ludlow, New Brunswick, Canada email@example.com
Simply send Char(7) - the BEL sequence - to the printer. With a generic printer driver this should work. If it doesn’t, another trick might be useful: You could create a batch file (Bel.Bat) which contains one line: Copy ^G > Lpt1: where ^G stands for the BEL character. From within Navision you can call this batchfile like: Hyperlink(C:\Bel.bat); Marcus Marcus Fabian phone: +41 79 4397872 firstname.lastname@example.org
Better solution for dealing with serial devices is to use an OCX for opening the drawer, but it is important NOT to use a windows printer at the same port because of conflicts. There are a number of possibilities for OCX: mscomm32.ocx or the SOFTSYS-Serial-Spooler, which you can use even for printing or opening cash drawers or for customer display. We developed a POS - AddOn for Navision Financials from 2.01 to 2.60, which is currently in registration at Navision Software. For that purpose we had the same problem. The hint with the Batch-File is very insecure and not useable because of some bugs within Microsoft Windows.