This article is a small reference on how a barcode scanner works in conjunction with 1C version 8.2 in a managed application mode. In order to “catch” the event of receiving a barcode from a scanner in 1C, a scanner driver must be installed on the system on which the 1C client is running. Here I will tell you how to set up the scanner when 1C works in thick or thin client. The work of the web client has not yet been studied by me.

So, the first thing to do is install the driver. I like ATOL drivers - they are easy to set up, work stably, old versions are free. To work with the scanner, a driver is suitable, which can be found on the ITS disk, its version: 5.8.3.262. An interesting feature of the eighth 1C platform is that now the driver distribution files can be stored as part of the configuration, programmatically check whether they are installed in the system and, if necessary, start their installation.

Check Availability installed driver you can by trying to connect the component and accessing the driver properties (the code can be executed on the client):

If it is found that the driver is not installed, you can proceed to launch the distribution. The distribution files must be inserted into the configuration as a layout with the “binary data” type, you can use General layouts. At my place, I made a general layout called DriverATOLScannerBarcode, loaded into it a distribution kit packed in zip with the name Scaner.zip, the distribution kit contains two files, one of which is Setup.exe, which you need to run. The order is simple - unpack the archive into a temporary directory, start the installation, after installation we clean up the files. To get a file from a layout on the client, you need a server procedure, in my example, this is the procedure GetServerLayout(), here is its text:

And here is the code that will run the driver installer:

When this code is executed, the distribution files will be downloaded to the client's machine and the installation will be launched there - the user will see the barcode driver installer window.

After the installation is completed, you need to configure the scanner properties, in Windows 7 and 8 you need to use the utility that comes with the driver, you can find it in the menu by the word “driver”, an example for Windows 8:

You need to run the utility as an administrator, it is also important that no other programs that use driver objects are running at this moment. For example, if the above code installed the driver and connected the component to 1C, the driver will already be running and its properties cannot be changed. Therefore, it is better to close 1C-ku. After launching the configuration utility, we see the following window:

In this window, you need to click the “Setting properties” button, the following will open:

Here you need to select the connection port, usually it is “Keyboard”, the last one in the list of ports, then check the boxes “Device on”, “Turn on the device at startup”. Set prefix and / or suffix - these are the characters that the scanner adds to the data block when reading the code, usually it is “Enter” or “Tab” (tab). To see the string received by the driver from the scanner, you need to go to the “Hardware Search” window and read any barcode - “extra” characters in the received string will be the desired prefixes or suffixes. The prefix and suffix characters are programmed in the scanner's memory, they can be changed, an example is described here: .

Now back to 1C. In order for the scanner to work, before using it on the client, you must execute the command Connect External Component ("AddIn.Scaner45"). It is better to perform it in the Attempt / Exception construct, if the driver is installed incorrectly or not installed at all, it will be possible to handle the exception and inform the user about the error. After this command, you can call the driver object and set the desired properties:

Usually I insert this code into a module that is executed when the client starts, and I check the need to use the driver through the appropriate user or workplace settings.

After the driver is installed and launched, you can process the ExternalEvent() in the necessary forms, an example of a procedure from the form of the product directory element, when reading the barcode, its value is inserted into the “Barcode” form attribute:

The Source parameter can be used to determine that the procedure was triggered by an event in the barcode scanner driver, while the Data parameter contains the barcode that was read. In the above example, the CheckBarcode() function executes a query to check if this barcode is used in another element and returns FALSE if it is, i.e. You cannot use the received code.

In this article, we will consider in detail the procedure for connecting a barcode scanner to a computer and organizing its work with the 1C program.


The use of scanners is becoming more and more popular. These devices are widely used not only in retail trade. Their use allows you to automate the following operations:

  • Search for nomenclature units in directories
  • Posting and sale of goods and materials
  • Internal operations (relocation, inventory, etc.)

In a word, this not a tricky device allows you to significantly optimize the accounting of material assets and, which is very important, significantly increase the accuracy and relevance. warehouse accounting by reducing the influence of the "human factor".


The first time you connect your device to your computer, Windows will treat the scanner as unknown device input. In the basic configuration of the system, there are all the necessary drivers, which allows the system to easily recognize the device. There are three ways to hardware connect the scanner to a computer:

  • Into the keyboard break
  • Via COM port
  • Via USB port

Although we connect the scanner using the example of UT, it is connected in the same way in the configurations 1C: UPP 8, 1C: Retail 8, 1C: Integrated Automation 8


Most of the currently produced scanners are connected to a computer via a USB port, so below we will consider only this connection option.

To connect the scanner to the 1C program, you will need to do the following:

After connecting the scanner to the computer and installing the necessary software(drivers), you should test the device. Such a check can be performed in the "notepad" by scanning any barcode


Next, you need to put the scanner into com-port emulation mode. To do this, you need to scan the "USB Serial Emulation" barcode, which is in the instruction manual for any scanner. On this, the procedure for hardware connection of the scanner can be considered complete and you should proceed to the 1C program


To work with barcode scanners in the basic 1C configuration, an external utility "! C: Barcode Scanner" is provided. This program, using a manual reader, receives the code and transfers it, for further processing, to the 1C program. To activate this utility, you need to launch the ScanOPOS application and follow the step-by-step installation. It is recommended not to change the settings offered by the program by default


After the external utility is ready to work, we go directly to the 1C program.

Select the menu item "Service" -\u003e


"Trade Equipment" ->


"Connecting and configuring commercial equipment"





"Add" (the directory "Trade equipment" will open) ->


"Add" (a submenu will open for creating a new piece of retail equipment)




Next, in the submenu that opens, specify the name of the scanner, model, software file (1CScanOPOSScan_v2.epf) and click "add" Next, create a group of users who will have access to the scanner. In modern scanner models, the software allows you to flexibly administer the available scanner interface, which significantly increases the convenience and efficiency of using these devices.




Click on the "Select" button and fall out into the element of the reference book "Trade equipment"





Click on the "Check all connected equipment" button. If a similar message appears



You need to install the barcode scanner driver. After installing the driver, click the "Check all connected hardware" button again.



The Barcode Scanner Driver tab shows the device settings. Press the button "Search for equipment"



The numbers 4714218000016 are the barcode itself as it is on the package. Symbols #13 indicate that along with the barcode from the package, the scanner transmits service data. The characters before the barcode are called the prefix, and those after the barcode are called the suffix.





In Trade Management version 10.3.6, user groups have been removed. Now we can open the "Nomenclature" directory and scan the barcode.





The final stage of the installation is to check the installed equipment and the correct functioning of its software. To carry out such a check, you can create a document "receipt of goods and services" and fill it out using a scanner. "At the same time, a barcode should be automatically entered into the cards of the selected goods. If you use the scanner for the first time, then after reading the barcode of a new product, the system will ask for permission to save the code, while automatically checking its correctness.

1C: Entrepreneur 8

The program "1C: Entrepreneur 8" - was created for accounting and reporting by individual entrepreneurs IE, PE, PBOYuL. The program allows you to keep a Book of Accounting for Income and Expenses and Business Operations of Individual Entrepreneurs who are payers of income tax individuals(personal income tax).


1C: Enterprise 8 Licenses.

If you need to work with the 1C program on more than one computer (this can be the local network), as well as when working in one 1C database, it becomes necessary to buy 1C licenses. 1C licenses are additional protection keys for 1C programs that are purchased separately and give the right to use on several computers.


Connecting the scanner to 1s Enterprise

Oh, and this article has been asking for a long time. Each client had to tell and show the setup steps. We decided to help those who are thirsty to independently connect the scanner to the 1c program. (Why exactly by 1c-well, 80% work on it, and in other programs, as a rule, there are no problems)

By setting up a usb barcode scanner Metrologic MS9540 and other models.

For 1s7
1 Connect the barcode scanner to the computer
2 The driver hardware is searched, after a short search, it installs a usb hid-compatible device (this is usually if we have hardware like USB). The scanner is installed askeyboard emulator. We check in a notebook - we hatch any that comes to hand product.
3 If we need a scanner in COM mode then: we need to get a book with programming barcodes and find the right option for example for MS9540 print 68 pages and
page 2 (numbering according to the book-numbers in the lower left corner, and not according to the sheets.
4 Now let's start programming the scanner.

On sheet 2, scan the Enter / Exit Conficuration Mode code -we hear a strange squeak of the scanner, we entered the programming mode. Anddem on page 68 scan the code with the inscription Enable Usb Serial Emulation Code, go back to page 2 and scan the same thing there

Enter/Exit Configuration Mode. This completes the scanner programming process.

5 The scanner has been reprogrammed into the com port emulation mode, now we need to find the driver, we point it to our driver - Metrologic MS5145 Eclipse.rar.
In the device manager, equipment of the type (Holliway Metrologic ComX) should appear - where X is the com port number. If this did not happen, you missed the driver installation process, then we change the scanner to another usb port and return to step number 4.
6 We install the utility from atol, you can choose to install automatically or selectively, select only the input device.
7 We start the scanner test, find the button to search for equipment, scan any barcode with the scanner, look and see:Our code XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX000 3000000000"" We close the search for equipment, we expose our highlighted com portand in the suffix column, first select #13 then #10. We put a checkmark to turn off the equipment at startup and the device is turned on.
8 Next, in 1s7, we should, in theory, copy the atol driver, and we find it in Administration - settings for trading equipment and set it to connect. We get a message device connected successfully. We go to Administration - Options and check on the tab - Barcode Scanner, our clarified port speed and suffix settings.
If we do not see the scanner driver in 1s. Then we go to ProgramFiles / Atol or

ProgramFiles86/Atolwe are looking for Scanner1c.ert there, we throw all this dll into our extforms/equip database. Next, in 1s, we add a new scanner device, specify a new name for the scanner, show it on scaner1c.ert, scanner1c.dll, external processing, write the identifier - Scaner.


In 1Cv8, some of the drivers are already embedded in new versions or are available in your personal account and also on ITS disks.

If neither one nor the other is at hand, you can again turn to the driver from ATOL (

up to year 10, ATOL versions were free, after that it applies only to products from Atol),

therefore, either we look for the old version and pray


to fit or purchase a scanner from Atol.


In the variant Luck accompanied us when choosing

-Setting up commercial equipment

-Scanner Atol

- click on test driver,

look at "driver installed" or click


"install driver".









By the way, in 1C8 if the program costs

we also recommend connecting and configuring the scanner on a laptop as a keyboard emulation (by default they are already set like this - KEYBOARD21), just set the suffix #13. Thus, we will not get random hemorrhoids when reconnecting to another USB and automatically changing the COM port.

In fact, if the scanner is switched to emulation mode (well, or purchased) of a COM port, then the drivers from atol will be completely unnecessary. It remains only to find a driver from the manufacturer - we have something in the section. You can leave a request if it is at hand, we will throw it into the support section. Or you can order.

Download a set of small instructions with manuals + drivers from atol (old)

It is necessary to make an RMK (cashier's workplace) with a working scanner and other necessary functionality.

Procedure:

1. We put 1s, configuration.

To begin with, let's make a couple of users, the first one is always "Admin", the second we will call "Cashier" and give him full rights (for the test, for good, you need to configure personal rights) .

In the configurator (from the admin) we will correct the user "Cashier". We put "launch type" & "regular application"

"Use Connected Equipment" and "Use User Groups"

Administration & Accounting Settings.

User capabilities in RMK are configured in Administration & Additional user rights

2. We configure the scanner to emulate the com port, this will allow us to work in the RMC with the scanner without unnecessary troubles.

To do this, I needed to download the Symbol COM Port Emulation Driver v 1.8.5

because It’s no longer a desire to check, but before installing the driver, this instruction was applied:

Setting_scanners_Symbol_in_1C I also apply it, it shows a barcode for programming the scanner for emulation and setting the scanner in 1s.

Well, in principle, this completes the scanner setup. Now RMK will intercept all scanned barcodes.

Everything is the same only on Windows 7

The scanner installed automatically. I did not force it to emulate its COM port. The scanner works like a keyboard. For 1s, I had to set up the scanner so that it would first send F7 (input by stroke) + the stroke itself + enter.

Before you buy a barcode scanner, pay special attention to how the scanner will connect to your computer.

Despite the abundance of barcode scanners on the market, they all ultimately connect through one of four types of connectors or interface ports:

PS/2 Keyboard Gap - As the name implies, the barcode scanner plugs into the gap between the computer and the keyboard.

USB emulation (actually connected via usb port and settings as in PS / 2)

RS-232 Serial (Com) port - connects to Com port computer, but requires an additional power supply.

USB Emulation (actually connection via usb port and settings as in RS-232)

Setting up a barcode scanner in 1C programs in a keyboard gap

Setting up a 1C barcode scanner connected to the keyboard break is not at all difficult task. The first thing to do is to configure the barcode scanner prefix. By default, a barcode scanner that is plugged into the keyboard gap when scanning a product barcode returns the barcode digits and the backspace character - this is the same as if you pressed the ENTER key on a computer keyboard after scanning. However, to scan the barcode of the product in the 1C program, press the F7 key - Carriage return is necessary. In order not to constantly press F7, adding special character- prefix. In this case, a prefix is ​​a certain set of characters that the scanner sends before sending a barcode. As a prefix, the value “150” is mainly used - this is the ASCII code for the F7 key. This the way is fine and for a USB scanner when it is not possible to install a COM port emulation driver.

Setting up a barcode scanner in 1C programs via a USB port.

The 1C program does not see barcode scanners connected via a USB connector, but the operating system "sees" them perfectly Windows system. When you turn on the scanner for the first time operating system will offer to install its driver, but we will not allow it and refuse automatic installation and install the driver manually. As a rule, the COM port emulation driver is located on the disk supplied with the barcode scanner, there are also specialized utilities for setting the properties of the barcode scanner itself, such as: beeper volume, prefix, suffix, etc. Or there is a special user manual with configuration barcodes, by scanning which you can configure the scanner in a certain way. During the installation of this driver, the operating system creates a virtual COM port. The next step is to configure the port. After the scanner itself is configured, we proceed to the configuration in 1C. To do this, in the menu Service? Settings of commercial equipment? We find the Scanners tab and go to it and install a new barcode scanner. As processing, the supplied standard maintenance processing "1CScanOPOSScan_v2.epf" is usually used. Next, go to “Parameters” and configure the COM port and the Scanner Speed ​​parameter. Barcode scanner set up!

Setting up a barcode scanner in 1C programs via a COM port.

We configure the 1C barcode scanner as in the previous example. After the scanner itself is configured, we proceed to the configuration in 1C. To do this, in the menu Service? Settings of commercial equipment? We find the Scanners tab and go to it and install a new barcode scanner. As processing, the supplied standard maintenance processing "1CScanOPOSScan_v2.epf" is usually used. Next, go to “Parameters” and configure the COM port and the Scanner Speed ​​parameter. Barcode scanner set up!

SCANNER SETUP IN 1C

Setting up a barcode scanner in 1C is a simple matter. The question itself is quite common. At the same time, it is difficult to find the answer to it on the Internet in such a way that everything is very clear. In fact, setting up a scanner is not difficult, firstly, you need to clearly, in a certain sequence, carry out actions. You also need to take a break from everything and unload the computer as much as possible. If you're ready, then let's get started.

How to set up a barcode scanner in 1s?

To set up a barcode scanner, remote computer we need the MetroPOS and ScanOPOS programs. Install the necessary set. We will need it to support the scanner:

Rice. 2

First, connect the barcode scanner to the computer. In this case, it is advisable to read the instructions for the scanner so that there are no problems. You should find the barcodes in the table here. It's called "Default settings". Found? Now let's reset the settings. After that, you need to install MetroPOS. This utility will check if the scanner settings are correct. Loading configuration file. Check if the scanner can read barcodes.

Rice. 3

2). We select the scanner that we install.

Rice. four

3). Now select the COM port to which the scanner is connected. Click "upload".

Rice. 5


The scanner should beep. Then click on the "download" icon.
Next, click on the “Terminal Window” button, a window will open:

Rice. 6


four). We scan any barcode, it should be in this window.

Rice. 7


Now we go into the terminal session and configure the scanner on the remote computer. We do the same steps.

How to set up a barcode scanner in 1C.

We go sequentially to the tabs: service - retail equipment - connection and configuration of retail equipment.

Rice. eight


Next, switch to the "Barcode Scanners" tab. Click "add new". In the window that appears, you need to select maintenance processing.

Rice. 9


We set an arbitrary name for the configuration of our scanner and complete by pressing the "OK" button
Next, click "Verify". At this stage, we check whether the parameters of the port to which we connected the scanner are set correctly, and we carry out tests. If everything is set up correctly, we will see “Test passed” on the screen.

Terminal port forwarding/barcode scanner

Now let's see how the port forwarding works, which are carried out using the Windows Terminal Service, which automatically forward the COM and LPT ports. Redirection is enabled by checking the "serial ports" checkbox in the "Devices" panel.

We check whether port forwarding occurs in a remote terminal session, we must enter the command in the command line: “change port /query”.
Command line should give this message.

Rice. ten

If everything is as shown in the figure, then the redirect is working.

If the redirect does not work, we find out the reason. We look at the system settings windows server 2003/2008 Terminal Services installation, and whether ports are forwarded on the server itself.

Thus the problem how to set up a barcode scanner in 1C, is solved quite quickly if you follow the order of the steps described above. It should also be remembered that if unforeseen circumstances appear in the process of work. The program or computer starts to freeze, it is better to stop the whole process and reboot. At the same time, before starting the setup, it is better to close all used applications. You can also read the article on how to update 1s, which describes detailed instruction step by step.