The essence of the program is to collect data coming on COM port ( the
RS232 ) to parse the data and transmits and t 1C , program consists of two
parts, the outer component itself reader.dll and configurator in an external
component that is reader.dll
The program interface consists of one window
Group COM PORTS
In
this group, you can select the com port with any com port you want to work, the
team the “Open Com Port” Opens the selected com port and then becomes available
two teams the “Close Com Port” and “Enable monitor Com Port” teams and the
“Close Com Port” closes the com port open, the ”Enable monitor Com Port” command
enables com port monitoring, that is, all information coming to the com port
will be displayed in the corresponding windows.
Group LIST OF COM PORTS
in
this group , with the command “ADD COM port information to list” add the
selected com port to the list and with the command “REMOVE SELECTED COM port
from list” delete the selected com port from the list.
Group COM port Parameters
In this
group you can set com port parameters
Group Reader Templates
In this group, all commands and input fields relate to how you want to convert
the data coming on the port.
Entry field input the "Input template" here prescribes that comes to com port
say on whom port comes = 02000000 this record , use the command the
“Copy of value the From com” , will be active after the inclusion of monitoring
com port, copy the incoming data in this field.
Here we enter the input field “Output template” here that we want a take from
the field “Input template” example, if in the “Input template” = 02000000 and in the field “Output template” we
write 011111111 then from = 02000000 the = symbol will be skipped
and 02000000 characters will be taken , then the number 0 says that the
corresponding symbol number does not need a take and the number 1 says
the corresponding symbol number is a take.
Example
1
Example
2
Drop-down list “After action”
you
can select the arithmetic action that will be applied to the result of the
converted number, that is, if the data comes to com port = 02000000 and we
take 02000000 from the template and at the same time “After action” is selected
* (multiplication) and in the field “Action value” write down the number 2 at
the output we get the number 4000000 i.e. 2000000 times 2
Switch
“Reverse value”
if
the data coming to the com port is turned on, that is, if the line = 02000000
comes and according to the pattern 011111111 we took 02000000 at the output we
get 00000020
The
next three input fields are “Line
Start Character”, “Line Ende Character” and “Characters count”
work together in the floor is, the input “Line End Start the Character” written
symbol on which the program will be the beginning of the data string in
the entry “Line Ende Airport the Character” written symbol on which the program
will be considered the end of the row of data that is, if the data comes to COM
port continually =02000000#=02000000#=
02000000#=02000000#=02000000#=02000000#=02000000#
in the input field "Line Start Character”write
the symbol = and in the input field "Line Ende Character " write # at
the output we will get the parsed line 02000000
the second example, if data is coming continuously on
which port
=02000000=02000000=02000000=02000000=02000000=02000000=02000000=02000000=02000000
in the input field "Line Start Character"
write the symbol = and in the input field "Line Ende Character" leave
empty and in the input field "Characters count" write
the number 8 at the output we will get the parsed line 02000000
Field input "Line end hex string" and switches
Using input
field
"Line end hex string"
can be
defined in the end of the line hexadecimal example 0D0A corresponds to the set
of Carriage Return + Line feed
Group For 1C
In the
"Event
Name" input
field , a name is written, for example, datareader1 by which 1C in the External
Event (Source, Event, Data) procedure , this name will be displayed in
the Event , that is , 1C will determine from which port the data comes from.
The
command loads the previously saved configuration.
Command cox injuring configuration
Save reader.dll to
disk
Register reader.dll in the system
Unregister reader.dll of system
Coming
to the data port can be seen here
in
the field "values converted from template"
will
be displayed already parsed string that will be transmitted in 1C
Calls from
1С
ПодключитьВнешнююКомпоненту("C:\dll\reader.dll","Ves");
Попытка
UNIVERSAL_READER=Новый
("AddIn.Ves.readerEx");
Исключение
Сообщить( ОписаниеОшибки())
КонецПопытки
Data will come
Процедура
ОбработкаВнешнегоСобытия(Источник,Событие, Данные)
Сообщить(Источник);
Сообщить(Событие);
Сообщить(Данные);
КонецПроцедуры
Initializing
Процедура Команда1(Команда)
Попытка
UNIVERSAL_READER.иницКом();
Исключение
Сообщить( ОписаниеОшибки());
КонецПопытки
КонецПроцедуры