0% found this document useful (0 votes)
88 views26 pages

MSIXML Design v1 7

Uploaded by

p1cador
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views26 pages

MSIXML Design v1 7

Uploaded by

p1cador
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 26

SOFTWARE DESIGN DOCUMENT

XML S ERVER S UPPORT FOR M ICRO L OK


S IMULATOR

VERSION: 1.7

Dated: 6 July 2016

Prepared By: Prepared For:


Professional Software Associates, Inc. Ansaldo STS
414 Lake Nepessing Road 1000 Technology Dr.
Lapeer, Michigan 48446 USA Pittsburgh, PA 15219 USA
Phone +1.727.724.0000 Phone +1.412.688.2400
www.psa-software.com www.ansaldo-sts.com
Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are only used for
identification and explanation, without intent to infringe.
Copyright Notice:
Copyright © 2021 – Professional Software Associates, Inc. All rights reserved.
Permission to copy for internal use only is granted to Ansaldo STS. This document may not be reproduced or
distributed in whole or in part in any form outside of Ansaldo STS without prior written permission from
Professional Software Associates, Inc.
REVISION HISTORY
REVISION AUTHOR(S) DESCRIPTION OF REVISION DATE COMPLETED
0.1 Maxim Amanenko Initial Release of document 04 February 2016
0.2 Andrew Martell Updated: 9 February 2016
Receiving XML updates over the XML Server interface
0.3 Maxim Amanenko Comments addressed 10 February 2016
0.4 Andrew Martell We made a quick update, please update the <f2> response 10 February 2016
with the correct <SERVER> structure
1.0 Maxim Amanenko Comments addressed 11 February 2016
1.1 Sergey Tiatenkov STAGE 2.C updated for the RAW device description 15 April 2016
1.2 Andrew Martell Updated: 12 May 2016
1.1 Objective
2.1 Receiving XML updates over the XML Server
interface
1.3 Sergey Tiatenkov STAGE 2.C updated for the RAW device description 12 May 2016
1.4 Sergey Tiatenkov RAW device description is updated for the deviceName 16 May 2016
field
1.5 Sergey Tiatenkov Bit name descriprion updated 20 May 2016
1.6 Sergey Tiatenkov a. Removed requirements for the raw device type 5 July 2016
b. XML Server interface description updated to
allow write functionality
1.7 Sergey Tiatenkov a. Updated MicroLok Simulator XML Server 6 July 2016
communication flow
b. Added Update requests to the MicroLok
Simulator XML Server description

Professional Software Associates, Inc.


Revised:
SIGNATURE

This MSIXML Design Document is required for development of the XML Server Support for MicroLok Simulator
Project to be performed by Professional Software Associates, Inc., for Ansaldo STS (“Customer”).

APPROVED BY:

Ansaldo STS Date

PREPARED BY:

Professional Software Associates, Inc. Date

Professional Software Associates, Inc.


Revised
CONTENTS

1. PURPOSE................................................................................................................................................................................1
1.1 OBJECTIVE........................................................................................................................................................................1
1.2 REFERENCES.....................................................................................................................................................................1
2. OVERALL DESCRIPTION..................................................................................................................................................2
2.1 RECEIVING XML UPDATES OVER THE XML SERVER INTERFACE....................................................................................2
2.2 XML SERVER INTERFACE OVER A DIFFERENT PORT TO MLK SIMULATOR.....................................................................5
2.3 PROCESSING XML-RPC CALLS FOR MANAGING BITS AND CONFLICTS RESOLUTION.....................................................19

Professional Software Associates, Inc.


Revised
XML Server Support for MicroLok Simulator SOFTWARE DESIGN DOCUMENT Confidential

1. PURPOSE

1.1 Objective
The purpose of this document is to give the general overview of the approach to the XML Server Support for
MicroLok Simulator updates and provide the high-level design of the required updates and implementation of new
features.
The updates will be performed with regard to the following requirements and assumptions:
 Ensure that the XML Schema is consistent with the configuration tool and device types and adheres to
the XML Schema Standards http://www.w3.org/standards/techs/xmlschema#w3c_all.
 Provide support receiving XML updates over the XML Server interface so the Microlok Simulator does
not need to poll clients.
 Add an additional XML Server interface over a different port to MLK Simulator that presents all bits
read only diagnostics.
 Verify functionality for processing XML-RPC calls to set write status to bits that allow clients to
control bits, and ensure that Microlok Simulator is able to resolve conflicts of bit ownership without
masking.

1.2 References
The information contained within this Functional Requirements is prepared based on the following
documentation and sources:
 Notes on the requirements gathering sessions with Ansaldo STS personnel.

Professional Software Associates, Inc.


Revised: 6 July 2016 Page 1
XML Server Support for MicroLok Simulator SOFTWARE DESIGN DOCUMENT Confidential

2. OVERALL DESCRIPTION

2.1 Receiving XML updates over the XML Server interface


Solution removes polling logic that periodically sends requests to TC Server in order to obtain state changes. After
connection with the TC Server a request is sent once to synchronize the TC Server with the MicroLok Simulator
using the XML-API. After initial synchronization the MicroLok Simulator shall behave like the TC-Server as a
client/server utilizing the XML-API to send and receive updates on state change.
The communication flow between the MicroLok Simulator and the TC Server is defined in the following figures:

STAGE 1 – Establish Bi-directional TCP socket connection

MLK Simulator TC Server


(XML Client) (XML Server)

A. Microlok Simulator opens a persistent bi-directional TCP connection with the TC-Server.

The IP address and Port of the TC-Server is defined in the Microlok Simulator GUI. The TC-Server does
not acknowledge the bi-directional TCP socket connection. It accepts the bi-directional TCP socket
connection, and the TC-Server is now listening for request on the connection, and publishing state
changes (updates) on the connection between the TC-Server and Microlok Simulator.

STAGE 2 – Synchronize TC-Server Data and Microlok Simulator Data START


Professional Software Associates, Inc.
Revised: 6 July 2016 Page 2
XML Server Support for MicroLok Simulator SOFTWARE DESIGN DOCUMENT Confidential

MLK Simulator TC Server


(XML Client) (XML Server)

C B

D E

A. The Microlok Simulator sends a request to the TC-Server to get all the FIELD_DEVICES.VALUE
(This is the global database of devices and the device values, when people talk about the TC-
Server database, this is what they are referring to, and this is the method to get the global data)
refer to the XML-API document this is a FC <message length> <XML-DATA> F6 message:

XML-DATA:
<REQUESTS>
<CMD NAME="ADAPT">
<REQUEST> target={FIELD_DEVICES.VALUE} name={}</REQUEST>
</CMD>
</REQUESTS>

B. The TC-Server will respond to the Microlok Simulator with all FIELD_DEVICES.VALUES refer to the
XML-API document this is a F2 <message length> <XML-DATA> F6 message:

XML-DATA:
<FIELD_DEVICES>
<VALUE UPDATE="0">
<SWITCHES COUNT="1">
<SWITCH NAME="STREET.1">
<NWC-W>
<VALUE>1</VALUE>
</NWC-W>
<RWC-W>
<VALUE>0</VALUE>
</RWC-W>
</SWITCH>
</SWITCHES>
<SIGNAL_LAMPS COUNT="1">
<SIGNAL_LAMP NAME="STREET.2SGO">
<GO>
<VALUE>0</VALUE>
</GO>
</SIGNAL_LAMP>
</SIGNAL_LAMPS>
<TRACKS COUNT="1">
<TRACK NAME="STREET.1">
<OCCUPANCY>
<VALUE>1</VALUE>
</OCCUPANCY>
<SPEED_CODE>
<VALUE>0</VALUE>
</SPEED_CODE>
</TRACK>

Professional Software Associates, Inc.


Revised: 6 July 2016 Page 3
XML Server Support for MicroLok Simulator SOFTWARE DESIGN DOCUMENT Confidential

</TRACKS>

</VALUE>
</FIELD_DEVICES>

C. The Microlok Simulator must parse the XML from the TC-Server.
D. Update MLC subsystem and a new device type raw<Device deviceId="" deviceName=" Microlok Name.Bit
Name" deviceType="raw"> and add metadata to the raw <Device> structure:
E. <OBJECT_TARGET> </OBJECT_TARGET> = XML root path in the TC-Server database
F. <OBJECT_NAME> </OBJECT_NAME> = Microlok Name.Bit Name
G. <OBJECT_TYPE> </OBJECT_TYPE>= READ or READ_WRITE
H.
I. XML tree path
J.
K. <root>
   <child>
     <subchild>.....</subchild>
   </child>
</root>
L.
M. For Example:
N. <TRACK name=“N2_1251TR”>
   <OCCUPANCY>
     <VALUE>0</VALUE>
   </OCCUPANCY>
</TRACK>
O.
P. Example MLC:
Q.
R. <?xml version="1.0" encoding="UTF-8"?>
S. <FieldDevices>
T. <Global Configuration="TC">
U. <server>172.21.8.10</server>
V. <port>5555</port>
W. <pollrate>2000</pollrate>
X. </Global>
Y.
Z. <Device deviceId="" deviceName="MKii8.N2_1251TR " deviceType="raw">
AA. <OBJECT_TARGET>TRACK.OCCUPANCY.VALUE</OBJECT_TARGET>
BB. <OBJECT_NAME>MKii8.N2_1251TR</OBJECT_NAME>
CC. <OBJECT_TYPE>READ_WRITE </OBJECT_TYPE>
DD. <Configuration>
EE. </Configuration>
Professional Software Associates, Inc.
Revised: 6 July 2016 Page 4
XML Server Support for MicroLok Simulator SOFTWARE DESIGN DOCUMENT Confidential

FF. <startupState>0</startupState>
GG. </Device>
HH. </FieldDevices>
II.
JJ.
KK. Parse the TC-Server response and update the Microlok Simulator bits values in the Data table that are
tagged in the MLC with OBJECT_TYPE>READ_WRITE</OBJECT_TYPE> only if the status is different that the
data from the TC-Server.

LL. The Microlok Simulator publishes an XML update to the TC-Server with all the bit values in the
Microlok Simulator Data table that are tagged in the MLC with OBJECT_TYPE>CONTROL, READ or
READ_WRITE</OBJECT_TYPE> only if the status is different than the data received from the TC-
Server. Refer to the XML-API document this is a FC <message length> <XML-DATA> F6 message.

MM.

NN. The TC-Server accepts the updates OBJECT_TYPE>CONTROL or


READ_WRITE</OBJECT_TYPE> from the Microlok Simulator and updates its database. The TC-
Server responds back with the F2 <message length> <XML-DATA> F6 message.

STAGE 2 – Synchronize TC-Server Data and Microlok Simulator Data END

STAGE 3 –TC-Server publishes Data and Microlok Updates Data

Professional Software Associates, Inc.


Revised: 6 July 2016 Page 5
XML Server Support for MicroLok Simulator SOFTWARE DESIGN DOCUMENT Confidential

MLK Simulator TC Server


(XML Server) (XML Server)

B A

A. The TC-Server send an update to the Microlok Simulator with the XML-API message F2
<message length> <XML-DATA> F6 message.

B. The Microlok Simulator parses the TC-Server message and update the Microlok Simulator bits
values in the Data table that are tagged in the MLC with OBJECT_TYPE>INDICATOR, READ or
READ_WRITE</OBJECT_TYPE> only if the status is different than the data from the TC-Server.

STAGE 4 –Microlok Simulator publishes Data and TC-Server Updates Data


MLK Simulator TC Server
(XML Server) (XML Server)

A B

A. The Microlok Simulator sends an update to the TC-Server with the XML-API message F2
<message length> <XML-DATA> F6 message.

B. The TC-Server parses the message and updates the TC-Server values in the Database.

Figure 1 – MICROLOCK Simulator client XML communication flow

Professional Software Associates, Inc.


Revised: 6 July 2016 Page 6
XML Server Support for MicroLok Simulator SOFTWARE DESIGN DOCUMENT Confidential

2.2 XML Server interface over a different port to MLK Simulator


Suggested solution is to use as base component for the XML server standard Qt component QTcpServer. This
component allows creating server on dedicated port and communicating with clients via TCP/IP connection,
which is used as transport for XML messages exchange. The low level interface of the server will accept
client’s connections, transmit and receive TCP frames. These frames are used to transmit and receive XML
messages from high level functions of the XML server. High level server functionality will also provide
methods for parsing XML requests and generating XML responses. Since tThe server shall present all bits
read only diagnostics then it shall responds only to “Get” type of requests and “Post” requests shall be
discarded (the server just sends response with an actual value)processed to update the bit value if the write
status of the bit is set. Therefore the following type of requests shall generate responses from the server:
XML tree path

<root>
   <child>
     <subchild>.....</subchild>
   </child>
</root>

A. Get all the field devices values (“FIELD_DEVICES.VALUE”), refer to the XML-API document
this is a FC <message length> <XML-DATA> F6 message:
XML-DATA:
<REQUESTS>
<CMD NAME="ADAPT">
<REQUEST> target={FIELD_DEVICES.VALUE} name={}</REQUEST>
</CMD>
</REQUESTS>

The Server will respond to the XML Client with all FIELD_DEVICES.VALUE refer to the XML-
API document this is a F2 <message length> <XML-DATA> F6 message:

XML-DATA:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<RESPONSES count="1"><RESPONSE><TC_DB>
<FIELD_DEVICES>
<VALUE UPDATE="3537762469.337">
<TRACKS COUNT="3">
<TRACK NAME="WM337T">
<OCCUPANCY>
<VALUE>0</VALUE>
</OCCUPANCY>
<SPEED_CODE>
<VALUE>0</VALUE>
</SPEED_CODE>
</TRACK>
<TRACK NAME="WM341T">
<OCCUPANCY>
<VALUE>0</VALUE>
</OCCUPANCY>
<SPEED_CODE>
<VALUE>0</VALUE>
</SPEED_CODE>
</TRACK>
Professional Software Associates, Inc.
Revised: 6 July 2016 Page 7
XML Server Support for MicroLok Simulator SOFTWARE DESIGN DOCUMENT Confidential

<TRACK NAME="DN349T">
<OCCUPANCY>
<VALUE>0</VALUE>
</OCCUPANCY>
<SPEED_CODE>
<VALUE>0</VALUE>
</SPEED_CODE>
</TRACK>
</TRACKS>
<SWITCHES COUNT="2">
<SWITCH NAME="DN.13B">
<NWR>
<VALUE>0</VALUE>
</NWR>
<RWR>
<VALUE>0</VALUE>
</RWR>
<NWP>
<VALUE>1</VALUE>
</NWP>
<RWP>
<VALUE>0</VALUE>
</RWP>
</SWITCH>
<SWITCH NAME="DN.13D">
<NWR>
<VALUE>0</VALUE>
</NWR>
<RWR>
<VALUE>0</VALUE>
</RWR>
<NWP>
<VALUE>1</VALUE>
</NWP>
<RWP>
<VALUE>0</VALUE>
</RWP>
</SWITCH>
</SWITCHES>
<TRAIN_STOPS COUNT="1">
<TRAIN_STOP NAME="_WM341">
<VR>
<VALUE>0</VALUE>
</VR>
<POSITION>
<VALUE>-</VALUE>
</POSITION>
<VRCP>
<VALUE>0</VALUE>
</VRCP>
<VNCP>
<VALUE>1</VALUE>
</VNCP>
</TRAIN_STOP>
</TRAIN_STOPS>
<SIGNAL_LAMPS COUNT="2">
<SIGNAL_LAMP NAME="DN366GT">
<DGE>
<VALUE>0</VALUE>
</DGE>
<HGE>
<VALUE>0</VALUE>
</HGE>
<RGE>
<VALUE>1</VALUE>

Professional Software Associates, Inc.


Revised: 6 July 2016 Page 8
XML Server Support for MicroLok Simulator SOFTWARE DESIGN DOCUMENT Confidential

</RGE>
<UDGE>
<VALUE>0</VALUE>
</UDGE>
<URGE>
<VALUE>1</VALUE>
</URGE>
<SGE>
<VALUE>0</VALUE>
</SGE>
<LWGE>
<VALUE>0</VALUE>
</LWGE>
<KBL>
<VALUE>0</VALUE>
</KBL>
<RGP>
<VALUE>0</VALUE>
</RGP>
</SIGNAL_LAMP>
<SIGNAL_LAMP NAME="DN346GTST">
<DGE>
<VALUE>0</VALUE>
</DGE>
<HGE>
<VALUE>0</VALUE>
</HGE>
<RGE>
<VALUE>1</VALUE>
</RGE>
<LWGE>
<VALUE>0</VALUE>
</LWGE>
<RGP>
<VALUE>0</VALUE>
</RGP>
</SIGNAL_LAMP>
</SIGNAL_LAMPS>
</VALUE>
</FIELD_DEVICES>
</TC_DB>
<SERVER>
<CMD_DESCRIPTOR>
<REQUEST> TARGET={FIELD_DEVICES.VALUE} NAME={}</REQUEST>
</CMD_DESCRIPTOR>
<INDICATION>Retrieved</INDICATION>
<LATENCY_MS>4.004002</LATENCY_MS>
<TIME> 02/10/16 11:57:20.113</TIME>
</SERVER>
</RESPONSE> </RESPONSES>

B. Get the track circuits value ("TRACK"), refer to the XML-API document this is a FC
<message length> <XML-DATA> F6 message.
For example:
XML-DATA:
<REQUESTS>
<CMD name="ADAPT">
<REQUEST>target={TRACK.OCCUPANCY.VALUE} name={DN361T}</REQUEST>
</CMD>
</REQUESTS>

Professional Software Associates, Inc.


Revised: 6 July 2016 Page 9
XML Server Support for MicroLok Simulator SOFTWARE DESIGN DOCUMENT Confidential

The Server will respond to the XML Client with the value of corresponding parameter,
refer to the XML-API document this is a F2 <message length> <XML-DATA> F6 message;

For example:

XML-DATA:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<RESPONSES count="1">
<RESPONSE>
<TC_DB>
<TRACK NAME="DN361T">
<OCCUPANCY>
<VALUE UPDATE="3537418593.186">1</VALUE>
</OCCUPANCY>
</TRACK>
</TC_DB>
<SERVER>
<CMD_DESCRIPTOR>
<REQUEST> TARGET={TRACK.OCCUPANCY.VALUE} NAME={DN361T}</REQUEST>
</CMD_DESCRIPTOR>
<INDICATION> Retrieved Asserted</INDICATION>
<LATENCY_MS>1.999378</LATENCY_MS>
<TIME> 02/04/16 11:16:33.185</TIME>
</SERVER>
</RESPONSE>
</RESPONSES>

C. Get switches value ("SWITCH"), refer to the XML-API document this is a FC <message
length> <XML-DATA> F6 message;
For example:
XML-DATA:
<REQUESTS>
<CMD name="ADAPT">
<REQUEST>target={SWITCH.RWP.VALUE} name={DN.15D}</REQUEST>
</CMD>
</REQUESTS>

The Server will respond to the XML Client with the value of requested parameter, refer to
the XML-API document this is a F2 <message length> <XML-DATA> F6 message;

For example:

XML-DATA:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<RESPONSES count="1">
<RESPONSE>
<TC_DB>
<SWITCH NAME="DN.15D">
<RWP>
<VALUE UPDATE="3537418674.763">1</VALUE>
</RWP>
Professional Software Associates, Inc.
Revised: 6 July 2016 Page 10
XML Server Support for MicroLok Simulator SOFTWARE DESIGN DOCUMENT Confidential

</SWITCH>
</TC_DB>
<SERVER>
<CMD_DESCRIPTOR>
<REQUEST> TARGET={SWITCH.RWP.VALUE} NAME={DN.15D}
</REQUEST></CMD_DESCRIPTOR>
<INDICATION> Retrieved Asserted</INDICATION>
<LATENCY_MS>0.999928</LATENCY_MS>
<TIME> 02/04/16 11:17:54.762</TIME>
</SERVER>
</RESPONSE>
</RESPONSES>

D. Get train stops value ("TRAIN_STOP"), refer to the XML-API document this is a FC
<message length> <XML-DATA> F6 message;
For example:
XML-DATA:
<REQUESTS>
<CMD name="ADAPT">
<REQUEST>target={TRAIN_STOP.VR.VALUE} name={_DN361}</REQUEST>
</CMD>
</REQUESTS>

The Server will respond to the XML Client with the value of requested parameter, refer to
the XML-API document this is a F2 <message length> <XML-DATA> F6 message;

For example:

Professional Software Associates, Inc.


Revised: 6 July 2016 Page 11
XML Server Support for MicroLok Simulator SOFTWARE DESIGN DOCUMENT Confidential

XML-DATA:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<RESPONSES count="1">
<RESPONSE>
<TC_DB>
<TRAIN_STOP NAME="DN361">
<VR>
<VALUE UPDATE="3537417612.517">1</VALUE>
</VR>
</TRAIN_STOP>
</TC_DB>
<SERVER>
<CMD_DESCRIPTOR>
<REQUEST> TARGET={TRAIN_STOP.VR.VALUE 1} NAME={_DN361}</REQUEST>
</CMD_DESCRIPTOR>
<INDICATION> Retrieved Asserted</INDICATION>
<LATENCY_MS>2.987862</LATENCY_MS>
<TIME> 02/04/16 11:00:12.517</TIME>
</SERVER>
</RESPONSE>
</RESPONSES>

E. Get signal lamp value ("SIGNAL_LAMP"), refer to the XML-API document this is a FC
<message length> <XML-DATA> F6 message;
For example:
XML-DATA:
<REQUESTS>
<CMD name="ADAPT">
<REQUEST>target={ SIGNAL_LAMP.RGP.VALUE } name={}</REQUEST>
</CMD>
</REQUESTS>

The Server will respond to the XML Client with the value of requested parameter, refer to
the XML-API document this is a F2 <message length> <XML-DATA> F6 message;

Professional Software Associates, Inc.


Revised: 6 July 2016 Page 12
XML Server Support for MicroLok Simulator SOFTWARE DESIGN DOCUMENT Confidential

For example:
XML-DATA:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<RESPONSES count="1">
<RESPONSE>
<TC_DB>
<SIGNAL_LAMP NAME="DNA362GT">
<RGP>
<VALUE UPDATE="3537418291.650">1</VALUE>
</RGP>
</SIGNAL_LAMP>
</TC_DB>
<SERVER>
<CMD_DESCRIPTOR>
<REQUEST> TARGET={SIGNAL_LAMP.RGP.VALUE} NAME={DNA362GT}</REQUEST>
</CMD_DESCRIPTOR>
<INDICATION> Retrieved Asserted</INDICATION>
<LATENCY_MS>4.000664</LATENCY_MS>
<TIME> 02/04/16 11:11:31.650</TIME>
</SERVER>
</RESPONSE>
</RESPONSES>

F. Get bit value ("BIT"), refer to the XML-API document this is a FC <message length> <XML-
DATA> F6 message;
For example:
XML-DATA:
<REQUESTS>
<CMD name="ADAPT">
<REQUEST>target={BIT.VALUE 1} name={DN361.FLR}</REQUEST>
</CMD>
</REQUESTS>

The Server will respond to the XML Client with the value of the corresponding bit, refer
to the XML-API document this is a F2 <message length> <XML-DATA> F6 message;

For example:

Professional Software Associates, Inc.


Revised: 6 July 2016 Page 13
XML Server Support for MicroLok Simulator SOFTWARE DESIGN DOCUMENT Confidential

XML-DATA:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<RESPONSES count="1">
<RESPONSE>
<TC_DB>
<BIT NAME=" DN361.FLR ">
<VALUE UPDATE="3537418291.650">0</VALUE>
</BIT>
<TC_DB>
<SERVER>
<CMD_DESCRIPTOR>
<REQUEST> TARGET={BIT.VALUE 1} NAME={DN361.FLR}</REQUEST>
</CMD_DESCRIPTOR>
<INDICATION> Retrieved Asserted</INDICATION>
<LATENCY_MS>0.993729</LATENCY_MS>
<TIME> 02/04/16 11:06:49.782</TIME>
</SERVER>
</RESPONSE>
</RESPONSES>

The BIT NAME shall be resolved with the following mask:


<MLK name>.<Bit name>
Where:
<MLK name> is the first part of the BIT NAME devided by “.”,
<Bit name> is the rest of the BIT NAME.

Also, the XML server shall transmit XML messages with state changes to all its clients without any request from
them. These messages contain state changes for track circuits, switches, train stops, signal lamps and bits, these are
F2 <message length> <XML-DATA> F6 messages. Examples for each type of device are specified below:
A. Response for track value change:
XML-DATA:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<RESPONSES count="1">
<RESPONSE>
<TC_DB>
<TRACK NAME="DN361T">
<OCCUPANCY>
<VALUE UPDATE="3537418593.186">0</VALUE>
</OCCUPANCY>
</TRACK>
</TC_DB>
<SERVER>
<CMD_DESCRIPTOR>
<REQUEST> TARGET={TRACK.OCCUPANCY.VALUE 0} NAME={DN361T}</REQUEST>
</CMD_DESCRIPTOR>
<INDICATION>Asserted</INDICATION>
<LATENCY_MS>0.993729</LATENCY_MS>
<TIME> 02/04/16 11:06:49.782</TIME>
</SERVER>

Professional Software Associates, Inc.


Revised: 6 July 2016 Page 14
XML Server Support for MicroLok Simulator SOFTWARE DESIGN DOCUMENT Confidential

</RESPONSE>
</RESPONSES>

Professional Software Associates, Inc.


Revised: 6 July 2016 Page 15
XML Server Support for MicroLok Simulator SOFTWARE DESIGN DOCUMENT Confidential

B. Response for switch value change:


XML-DATA:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<RESPONSES count="1">
<RESPONSE>
<TC_DB>
<SWITCH NAME="DN.15D">
<RWP>
<VALUE UPDATE="3537418674.763">1</VALUE>
</RWP>
</SWITCH>
</TC_DB>
<SERVER>
<CMD_DESCRIPTOR>
<REQUEST> TARGET={SWITCH.RWP.VALUE 1} NAME={DN.15D} </REQUEST>
</CMD_DESCRIPTOR>
<INDICATION>Asserted</INDICATION>
<LATENCY_MS>0.993729</LATENCY_MS>
<TIME> 02/04/16 11:06:49.782</TIME>
</SERVER>

</RESPONSE>
</RESPONSES>

C. Response for train stop value change:


XML-DATA:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<RESPONSES count="1">
<RESPONSE>
<TC_DB>
<TRAIN_STOP NAME="_DN361">
<VR>
<VALUE UPDATE="3537417612.517">1</VALUE>
</VR>
</TRAIN_STOP>
</TC_DB>
<SERVER>
<CMD_DESCRIPTOR>
<REQUEST> TARGET={TRAIN_STOP.VR.VALUE 1} NAME={_DN361 }</REQUEST>
</CMD_DESCRIPTOR>
<INDICATION>Asserted</INDICATION>
<LATENCY_MS>0.993729</LATENCY_MS>
<TIME> 02/04/16 11:06:49.782</TIME>
</SERVER>

</RESPONSE>
</RESPONSES>

D. Response for signal lamp value change:


XML-DATA:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<RESPONSES count="1">
<RESPONSE>
<TC_DB>
<SIGNAL_LAMP NAME="DNA362GT">
Professional Software Associates, Inc.
Revised: 6 July 2016 Page 16
XML Server Support for MicroLok Simulator SOFTWARE DESIGN DOCUMENT Confidential

<RGP>
<VALUE UPDATE="3537418291.650">1</VALUE>
</RGP>
</SIGNAL_LAMP>
</TC_DB>
<SERVER>
<CMD_DESCRIPTOR>
<REQUEST> TARGET={SIGNAL_LAMP.RGP.VALUE 1} NAME={DNA362GT}</REQUEST>
</CMD_DESCRIPTOR>
<INDICATION>Asserted</INDICATION>
<LATENCY_MS>0.993729</LATENCY_MS>
<TIME> 02/04/16 11:06:49.782</TIME>
</SERVER>

</RESPONSE>
</RESPONSES>

Professional Software Associates, Inc.


Revised: 6 July 2016 Page 17
XML Server Support for MicroLok Simulator SOFTWARE DESIGN DOCUMENT Confidential

E. Response for bit value change:


XML-DATA:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<RESPONSES count="1">
<RESPONSE>
<TC_DB>
<BIT NAME=" DN361.FLR ">
<VALUE UPDATE="3537418291.650">0</VALUE>
</BIT>
<TC_DB>
<SERVER>
<CMD_DESCRIPTOR>
<REQUEST> TARGET={BIT.VALUE 0} NAME={DN361.FLR}</REQUEST>
</CMD_DESCRIPTOR>
<INDICATION>Asserted</INDICATION>
<LATENCY_MS>0.993729</LATENCY_MS>
<TIME> 02/04/16 11:06:49.782</TIME>
</SERVER>

</RESPONSE>
</RESPONSES>

The following type of requests shall be processed to update the bit value if the write status of the bit is set:
XML-DATA:
<REQUESTS>
<CMD NAME="ADAPT">
<REQUEST> target={ BIT.VALUE 1} name={ DN361.FLR }</REQUEST>
</CMD>
</REQUESTS>

And the following response shall be broadcasted to all the XML Clients:
XML-DATA:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<RESPONSES count="1">
<RESPONSE>
<TC_DB>
<BIT NAME="">
<VALUE UPDATE="3537418291.650">1</VALUE>
</BIT>
<TC_DB>
<SERVER>
<CMD_DESCRIPTOR>
<REQUEST> TARGET={BIT.VALUE 1} NAME={ DN361.FLR }</REQUEST>
</CMD_DESCRIPTOR>
<INDICATION>Asserted</INDICATION>
<LATENCY_MS>0.993729</LATENCY_MS>
<TIME> 02/04/16 11:06:49.782</TIME>
</SERVER>
</RESPONSE>

Professional Software Associates, Inc.


Revised: 6 July 2016 Page 18
XML Server Support for MicroLok Simulator SOFTWARE DESIGN DOCUMENT Confidential

If the write status of the bit is not set the request will be discarded.

Since the simulator software already contains of XML client that implements methods for parsing XML
request messages and generating XML response messages, this should be used in XML Server
implementation.
In accordance with suggested solution a typical communication flow of XML Server shall look as shown on
the figure below:

Professional Software Associates, Inc.


Revised: 6 July 2016 Page 19
XML Server Support for MicroLok Simulator SOFTWARE DESIGN DOCUMENT Confidential

MLK Simulator
XML Client
(XML Server)
Connection to Establish TCP connection Accept Client
the server connection

Initial requests to Request all


synchronize states of ‘FIELD_DEVICES.VALUE’
all field devices
(transmitted once)
All ‘FIEL_DEVICES.VALUE’
Updating state Response
all field devices

Get ‘SWITCH’
...

...
value request
‘SWITCH’ value
Updating Response
‘SWITCH’ state
Post ‘SWITCH’
...

...
Switch or
status value Request is
Lamp/Signal
bits changed discarded
Actual ‘SWITCH’ value
Response

Post track speed


...

...

Track speed code Request is


changed discarded
Actual track speed
code value Response

A Track circuit
...

...

Unrequested ‘TRACK’ state changed


Updating state data
‘TRACK’ state
A Switch state
...
...

Unrequested ‘SWITCH’
Updating changed
state data
‘SWITCH’ state

Professional Software Associates, Inc.


Revised: 6 July 2016 Page 20
XML Server Support for MicroLok Simulator SOFTWARE DESIGN DOCUMENT Confidential

Figure 2 – MicroLok Simulator XML Server communication flow

2.3 Processing XML-RPC calls for managing bits and conflicts resolution
Current implementation of the MicroLok simulator contains functionality that is responsible for processing
XML-RPC calls in order to provide clients with ability to control bits and resolve conflicts of bit ownership
with masking. Therefore the task is to verify that this processing logic operates properly. Therefore the
following steps shall be done to perform the task:
 Review implementation details and analyze parts of related source code;
 Prepare set of test cases which allows to generate XML-RPC calls for all possible bits types and ensure
that there is capability to control corresponding bits, verify absence of any conflicts of bit ownership;
 Perform all prepared test scenarios;
 Fix all the detected issues.

Professional Software Associates, Inc.


Revised: 6 July 2016 Page 21

You might also like