NOTE: This page has been translated automatically from Russian to English. Original page.



Emulation of the scanner bar code. Configuring the connection barcode scanner 7.7 1C and 1C 8.

If the hand is not a barcode scanner, and you want to check, debug the program. Work barcode scanner can be emulated by software. Described example of emulation: Setting used programs to connect and configure the scanner bar code in 1C and 1C 7.7 8.

Emulation works barcode scanner

If the hand is no barcode scanner, and you want to check, debug the program.
There are two options:

  • use standard tools to work with a barcode scanner and barcode scanner to emulate himself, as if he were physically connected to the COM-port (covered in this article);
    Benefits: complete efficiency checked 1C works with a barcode scanner, as in operating conditions;
    disadvantages: installation and configuration of additional software.
  • use special processing emulate events (for 1C 8 - through the standard procedure for 1C 7.7 - through external components - see links at end of article.);
    advantages: easy to install and configure the software and treatments;
    disadvantages eliminates check settings and libraries work with a barcode scanner, because generated by the event itself (you need to know the parameters of the event to the correct call)

Work barcode scanner can be emulated by software.

To send data to the COM-port, you can use the program " the COM the Port the Data Emulator " (free). "COM Port Data Emulator" emulates a device connected to a COM or Ethernet.

For the COM-port emulation, but rather to create a virtually connected to each other pairs of COM-port, you can use the program "Virtual Null Modem" (trial) or " the Virtual emulator the Serial the Ports " (free).

Create virtual COM-ports may be considered as using Virtual Null Modem, and using Virtual Serial Ports emulator.

1. First, create a linked pair of virtual COM ports. Ports are connected to each other as if it were ports on different devices connected by a cable (in this case: the port on the PC port on the scanner and barcode).

1. (1) Creating a related pair of virtual COM ports with Virtual Null Modem.
Install and run Virtual Null Modem (VNM).

In the VNM create a pair of COM ports "devices - Add a virtual null-modem"

Virtual Null Modem

The window "Virtual Ports":

The first virtual port - COM10.

The second virtual port - COM11.

Type null modem "With complete control of the transmission."

Окно Виртуальные порты

Click "OK"

If you type the start of "Manual", then to activate ports in the system to select the menu item "System - Activate all virtual null-modem".

1. (2) Creating a related pair of virtual COM ports with Virtual Serial Ports Emulator.
Install and launch the Virtual Serial Ports Emulator.

To get started, install the Russian interface language: «Language - Russian»

In the VSPE proceed to the creation of a pair of COM ports: "The device - Create"

VSPE - запуск настройки

Window "Device Type":

Окно Тип устройства

Here, select the type of «Pair» devices (ie, "Couple"). Click "Next".

Window "Device Type":

Here, select the type of device «Pair» (ie, "Couple")

The first virtual port - COM10.

The second virtual port - COM11.

Окно Характеристики устройства

Starting emulation:

To start, select menu "Simulation - Run"

Окно VSPE - эмуляция


2. Now, set up the connection of the barcode scanner to 1C.

Showing connection examples for the 1C: Enterprise 7.7 and 1C: Enterprise 8.

2. (1) Setting the barcode scanner connect to the 1C: Enterprise 7.7.

Настройка подключения в 1С 77

2. (2) barcode scanner Connection Setup in the 1C: Enterprise 8.

Настройка поключения в 1С 8


When the barcode scanner is configured, you can check it out.

3. Directly emulation barcode scanner

Install and run the COM Port DE (emulator).

COM Port Data Emulator

At the initial "the Device" tab: select the item «Serial port», set the following parameters "11"; «9600,8, N, 1"; «None». As the figure. "11" - a COM-port number specified in the second VNM.

We turn to the second «Data source» tab. There are a lot of settings. Let us consider the simplest use case.

Data source

Set «Data source» mode «Text strings» (ie the data source - a line of text).

Next two options:

1. Simple. Enter one line of text - the correct barcode. Pressing the «Start» button, the program will send 11 via COM barcode on COM 10 as configured, as if it were a real barcode scanner connected to .COM 10. Note: even if the set is a few lines with bar codes, only the first will be sent.

2. List. Enter a few lines with bar codes, for example, as shown below. Enable automatic sending of a flag with an interval «Auto sending interval (ms)». Select «Fixed» interval mode (fixed), specify the interval in milliseconds. Pressing the «Start» button, the program will send barcodes by line, with the specified time interval between the lines.

Stop sending cycle can be pressing «Stop» in the «Log» tab, which displays all the data sent.

Log

Important Notice

Do not try to test emulation barcode scanner built-in "test device" (the same for 77 and 1C 1C 8):

Тест устройства

As can be seen from the figure, this feature takes all the ports in the system, including the COM port 11, which is a link in conjunction COM 10 - COM 11. Thus, the emulator can not send barcode on COM COM 10 through 11, as already 11 COM busy this "test". Emulator will issue the corresponding error on port employment.

___________________________________________________

Options emulation barcode scanner works with the help of treatments generating events

1C:Enterprise Developer's Community