Moscow, Azovskaya 14
+7 (495) 310-97-15
Mo-Fr: 9.00 - 18.00 (Moscow time)
Order a call
Your name *
Enter phone *
Your Email *
Call me back
Integration into the Darktech system with a Premium controller (schneider electric)

Dosimetric control system

In March 2013, he performed interesting work on the creation of a monitoring and control system for an ionizing irradiator.

The main interesting points of this software product are:

1. Integration into the system with the Premium controller (Schneider Electric) of the Belarusian dosimetric control system of the Atomtech company “SARKtech” using a non-standard protocol

2. Output of current information from the system to MIGRA LED panels

The scheme for setting up the integration of the Atomtech dosimetric control system SARKtech with Premium was as follows ... First, everything was assembled in accordance with the factory schemes and the system was made to work as it was delivered from the factory. Then, having disconnected the connection between the panel and the assembled system itself, they began to sniffer the exchange protocol and observe which telegrams the computer program sends to the panel (requests) and which the panel itself sends (answers). There was a description of the protocol, but it was not of great value, since something in it did not correspond to the current state of affairs.


As a result, they brought a radionuclide emitter-tester and began to conduct tests, introducing each of the devices in turn into the “scale”.

Youtube video was created:

It turned out that variables of type REAL or Float have a rather strange format, consisting of only three bytes. No standard methods of converting data to the REAL data format were suitable, I had to turn to the help of experts and this is the solution I got:

C code, works without errors (this is how it was created in the panel):
//collects a float from three bytes
float R3toR4(BYTE a, BYTE b, BYTE c)

   float ret;
   void* pv = &ret;
   WORD e;
   BYTE s = a & 0x80;
   if((a|b|c)==0)return (float)0.0;
   a &= 0x7F;
   e = (WORD)( a + (BYTE)0x3e)<<7;
   ((BYTE*)pv)[3] = (HIBYTE(e)) | s;
   s = (b & 0x7f) | LOBYTE(e);
   ((BYTE*)pv)[2] = s;
   ((BYTE*)pv)[1] = c;
   ((BYTE*)pv)[0] = 0;
   return ret;

The C-code works perfectly, but in Unity Pro XL (ST) it didn’t matter.
Test Cases:
Input: 18317 14080  / 478D 3700
C-Value: 70.607422 / 428D3700
U-Value: 91.78

Input: 18137 20480  / 46D9 5000
C-Value: 54.328125 / 42595000
U-Value: 52.21

Input: 18137 5376  / 46D9 1500
C-Value: 54.270508 / 42591500
U-Value: 37.46

Input: 18136 62976  / 46D8 F600
C-Value: 54.240234 / 4258F600
U-Value: 123.4219

Code that works correctly in Premium controller (Schneider Electric):
tmp_WORD   := INT_TO_WORD((BYTE_TO_INT(a AND 16#7F)+62)*128);
(* the order was allocated, shifted to the standard, left shift by 7 bits - the ml bit of the order remains in the low byte *)
tmp_BYTE  := WORD_TO_BYTE(SHR(IN :=tmp_WORD, N := 8)) OR (a AND 16#80);
(* the sign bit is returned in the exponent byte *)
tmp_BYTE1 := (b AND 16#7F) OR WORD_TO_BYTE(tmp_WORD AND 16#FF); (* high byte of the mantissa *)
(* to the high byte of the mantissa, in which the high bit was discarded (in the IEE standard it is always non-stored 1) *)
(* fit the least significant bit of the order *)
First_WORD:= BYTE_AS_WORD (HIGH := tmp_BYTE, LOW := tmp_BYTE1);
Second_WORD:= BYTE_AS_WORD (HIGH := c, LOW := 0);
If (a=0) And (b=0) And (c=0) Then
  ret1 := 0.0;
  ret1 := WORD_AS_REAL (HIGH := First_WORD, LOW := Second_WORD);

 I also had to tinker with the panels (there were several of them), choosing the initially wrong path for the development of the situation. I began to torment the panels with a character-by-character output of ASCII codes. Yes, as it turned out, this can also be output, but the correct way is different - to prepare ready-made message templates in the panel program and output them according to the command code from the controller, like a program for working with a printer (sequences).


Цветные надписи

#Integrationofthirdpartyprotocols, #ShneiderElectric, #digitalpanel, #SARK

Be the first to comment

You comment add