<root>
<document scada='1' projtype='2' schema='103' license='1,88169790,EHXX2F' title='Blank Web' description='A blank Web App Developer project suitable for creating apps that run in a browser' fcversion='720899' target='SCADA.SCADA.WEBEXP' >
	<config data='' clkspd='100000000' simspd='0' usewdt='0' constif='0' Use3V3='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug />
	<traces />
	<ghost >
		<FK2 >
			<data name='FK2D0' port='4294967295' pin='4294967295' />
			<data name='FK2D1' port='4294967295' pin='4294967295' />
			<data name='FK2D2' port='4294967295' pin='4294967295' />
			<data name='FK2D3' port='4294967295' pin='4294967295' />
			<data name='FK2D4' port='4294967295' pin='4294967295' />
			<data name='FK2D5' port='4294967295' pin='4294967295' />
			<data name='FK2D6' port='4294967295' pin='4294967295' />
			<data name='FK2D7' port='4294967295' pin='4294967295' />
			<data name='FK2D8' port='4294967295' pin='4294967295' />
			<data name='FK2D9' port='4294967295' pin='4294967295' />
			<data name='FK2D10' port='4294967295' pin='4294967295' />
			<data name='FK2D11' port='4294967295' pin='4294967295' />
			<data name='FK2D12' port='4294967295' pin='4294967295' />
			<data name='FK2D13' port='4294967295' pin='4294967295' />
			<data name='FK2D14' port='4294967295' pin='4294967295' />
			<data name='FK2D15' port='4294967295' pin='4294967295' />
			<data name='FK2A0' port='4294967295' pin='4294967295' />
			<data name='FK2A1' port='4294967295' pin='4294967295' />
			<data name='FK2A2' port='4294967295' pin='4294967295' />
			<data name='FK2A3' port='4294967295' pin='4294967295' />
			<data name='FK2A4' port='4294967295' pin='4294967295' />
			<data name='FK2A5' port='4294967295' pin='4294967295' />
		</FK2>
		<ICD >
			<data name='AnalogPrescaleValue' value='19' />
			<data name='DigitalSampleRate' value='100000' />
			<data name='BreakpointCount' value='8' />
			<data name='CallStackDepthCount' value='8' />
			<data name='ClockPort' value='4095' />
			<data name='ClockPin' value='0' />
			<data name='DataPort' value='4095' />
			<data name='DataPin' value='0' />
			<data name='UseDefaultPins' value='1' />
			<data name='WrapEnabled' value='1' />
			<data name='CommsDelayOverridden' value='0' />
			<data name='CommsDelay' value='2' />
			<data name='CalculatedCommsDelay' value='2' />
			<data name='AnalogEB2PrescaleValue' value='2' />
			<data name='DigitalEB2SampleRate' value='100000' />
		</ICD>
		<pins >
			<digital A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
			<analog A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
		</pins>
	</ghost>
	<components >
		<settings autoimg='0' center='1' unitscale='0' fixedscale='1' fixedx='25' fixedy='25' fixedz='25' headcode='0' />
		<definition guid='f625bbf6-a67e-416f-92ea-49d1a46ae908' vstate='40' vmin='0' vmaj='1' srcleaf='WEBEXP_Websocket.fcsx' visiblename='WebSocketClient' description='A websocket client component which can be used to create a
2-way communications channel with a websocket server.' category=' Comms' category2='' category3='' bIs2dOnly='1' bIs3dOnly='0' bIsWysiwyg='0' catenable='1' author='MatrixTSL' manuname='' manucode='' sysinfo='1052939' keywords='' dynamic='1' scadaCompatible='1' embeddedCompatible='0' showmacros='1' iconpath='..\..\icons\components\Websocket.png' />
		<component class_type='root' codename='WebSocketClient' panelId='-1' x='0' y='0' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' varnames='$(type)_$(module)__$(variable:u)' >
			<resources />
			<properties >
				<property name='Url' target='sUrl' typeid='10' hidden='0' locked='0' info='The url of a WebSocket server, e.g. ws://127.0.0.1:8080/' />
				<property name='Debug' target='bDebug' typeid='7' hidden='0' locked='0' info='Determines if additional logging information is sent to the JavaScript console' />
				<property name='Callbacks' hidden='0' >
					<property name='OnOpen' target='macOnOpen' typeid='24' hidden='0' locked='0' info='Called when the connection to a WebSocket server is successfully established
' filter='NamOnWebSocketOpen
DesCalled when the connection to a WebSocket server is successfully established' />
					<property name='OnClose' target='macOnClose' typeid='24' hidden='0' locked='0' info='Called when the WebSocket connection has been lost
' filter='NamOnWebSocketClose
DesCalled when the WebSocket connection has been lost
ParCode|INT|The code for the Close event
ParReason|STRING|A string indicating the reason the server closed the connection
ParWasClean|BOOL|True if the connection was cleanly closed' />
					<property name='OnReceiveString' target='macOnReceiveString' typeid='24' hidden='0' locked='0' info='Called when a string-based WebSocket message is received' filter='NamOnWebSocketRxString
DesCalled when a WebSocket string message is received
ParMessage|STRING|The message received
ParEvent|HANDLE|Optional information about the received data' />
					<property name='OnReceiveArray' target='macOnReceiveArray' typeid='24' hidden='0' locked='0' info='Called when an array-based WebSocket message is received' filter='NamOnWebSocketRxArray
DesCalled when a WebSocket array message is received
ParArray[256]|BYTE|The data received
ParSize|INT|The size of the received array
ParEvent|HANDLE|Optional information about the received data' />
					<property name='OnError' target='macOnError' typeid='24' hidden='0' locked='0' info='Called when a WebSocket error occurs
' filter='NamOnWebSocketError
DesCalled when a WebSocket error occurs
ParEvent|HANDLE|Information about the error' />
				</property>
			</properties>
			<values >
				<value target='sUrl' data='ws://127.0.0.1' />
				<value target='bDebug' data='0' />
				<value target='macOnOpen' data='' />
				<value target='macOnClose' data='' />
				<value target='macOnReceiveString' data='' />
				<value target='macOnReceiveArray' data='' />
				<value target='macOnError' data='' />
			</values>
			<events >
				<event class='Compile' event='HtmlScriptHeader' target='Ev_HtmlScriptHeader' />
			</events>
			<apis >
				<api name='SendString' alt='SendString' type='1' proto='1' />
				<api name='Connect' alt='Connect' type='1' proto='1' />
				<api name='Disconnect' alt='Disconnect' type='1' proto='1' />
			</apis>
			<variables >
				<variable public='0' >
					<def class_type='variable' name='bConnected' type='b1' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='sClientId' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='23' />
					</def>
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='SendString' description='Sends a string to the connected WebSocket server (returns false in the client is not connected)' statediag='0' >
						<return name='Return' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Data' type='T8' description='The string data to send' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='2000' />
						</param>
						<local name='bDebug' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='sMsg' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<local name='iState' type='s32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.bDebug = (bDebug != 0)' />
							<exp exp='.Return = 0' />
						</command>
						<command class_type='call' title='User Macro' macro='GetState' >
							<return exp='.iState' />
						</command>
						<command class_type='decision' title='Decision' exp='.iState == 1' swap='0' >
							<flowline >
								<command class_type='decision' title='Decision' exp='.bDebug' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.sMsg = &quot;Sending WebSocket data: &apos;&quot; + .Data + &quot;&apos;&quot;' />
										</command>
										<command class_type='native' title='Javascript' ccode='console.log(FCL_SMSG);' language='C' />
									</flowline>
									<flowline />
								</command>
								<command class_type='native' title='Javascript' ccode='if (window[&apos;WS_&apos; + FC_THIS])
{
  window[&apos;WS_&apos; + FC_THIS].send(FCL_DATA);
  FCR_RETVAL = true;
}' language='C' />
							</flowline>
							<flowline >
								<command class_type='decision' title='Decision' exp='.bDebug' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.sMsg = &quot;Sending WebSocket failed (State = &quot; + ToString$(.iState) + &quot;)&quot;' />
										</command>
										<command class_type='native' title='Javascript' ccode='console.log(FCL_SMSG);' language='C' />
									</flowline>
									<flowline />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Connect' description='Connects to the WebSocket server (returns false if already connected)' statediag='0' >
						<return name='Return' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='bDebug' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='sUrl' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='2000' />
						</local>
						<local name='sMsg' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.sUrl = sUrl' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.bDebug = (bDebug != 0)' />
						</command>
						<command class_type='decision' title='Decision' exp='bConnected' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Return = 0' />
								</command>
								<command class_type='decision' title='Decision' exp='.bDebug' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.sMsg = &quot;Connecting WebSocket failed: Already connected&quot;' />
										</command>
										<command class_type='native' title='Javascript' ccode='console.log(FCL_SMSG);' language='C' />
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline >
								<command class_type='decision' title='Decision' exp='.bDebug' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.sMsg = &quot;Connecting WebSocket: &quot; + .sUrl' />
										</command>
										<command class_type='native' title='Javascript' ccode='console.log(FCL_SMSG);' language='C' />
									</flowline>
									<flowline />
								</command>
								<command class_type='native' title='Javascript' ccode='window.addEventListener(&quot;pageshow&quot;, (event) =&gt; {
	if (event.persisted) {
		window[&apos;WS_&apos; + FC_THIS] = new WebSocket(FCL_SURL);
		window[&apos;WS_&apos; + FC_THIS].binaryType = &quot;arraybuffer&quot;;
		window[&apos;WS_Listeners_&apos; + FC_THIS]();
	}
});' language='C' />
								<command class_type='native' title='Javascript' ccode='window[&apos;WS_&apos; + FC_THIS] = new WebSocket(FCL_SURL);
window[&apos;WS_&apos; + FC_THIS].binaryType = &quot;arraybuffer&quot;;
window[&apos;WS_Listeners_&apos; + FC_THIS]();' language='C' />
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Return = 1' />
								</command>
								<command class_type='native' title='Javascript' ccode='// Close the websocket when the user leaves.
window.addEventListener(&quot;pagehide&quot;, () =&gt; {
	if (window[&apos;WS_&apos; + FC_THIS]) {' language='C' />
								<command class_type='decision' title='Decision' exp='.bDebug' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.sMsg = &quot;Closing WebSocket: &quot; + .sUrl' />
										</command>
										<command class_type='native' title='Javascript' ccode='console.log(FCL_SMSG);' language='C' />
									</flowline>
									<flowline />
								</command>
								<command class_type='native' title='Javascript' ccode='		window[&apos;WS_&apos; + FC_THIS].close();
		window[&apos;WS_&apos; + FC_THIS] = null;
	}
});
' language='C' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='GetState' description='Returns the state of the current connection:
  0  = connecting
  1  = open
  2  = closing
  3  = closed or not created' statediag='0' >
						<return name='Return' type='s32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Default value' >
							<exp exp='.Return = 3' />
						</command>
						<command class_type='native' title='Javascript' ccode='if (window[&apos;WS_&apos; + FC_THIS])
{
  FCR_RETVAL = window[&apos;WS_&apos; + FC_THIS].readyState;
}' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Disconnect' description='Disconnect from the WebSocket server' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='bDebug' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='sHost' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<local name='sDir' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<local name='sClientId' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<local name='sPort' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<local name='sMsg' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.bDebug = (bDebug != 0)' />
						</command>
						<command class_type='decision' title='Decision' exp='.bDebug' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.sMsg = &quot;Disconnecting WebSocket&quot;' />
								</command>
								<command class_type='native' title='Javascript' ccode='console.log(FCL_SMSG);' language='C' />
							</flowline>
							<flowline />
						</command>
						<command class_type='native' title='Javascript' ccode='if (window[&apos;WS_&apos; + FC_THIS])
{
  window[&apos;WS_&apos; + FC_THIS].close();
}' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Ev_HtmlScriptHeader' description='Sent to a component to retrieve script code to be placed in the html header section' statediag='0' >
						<return name='Return' type='u32' description='Non-zero to block script code insertion' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='CompID' type='T8' description='The unique name of this component' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<param name='HeaderScript' type='T8*' description='Text to amend for the header script' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<local name='sNewClientId' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<local name='sMacro' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<local name='hParent' type='h32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.HeaderScript = &quot;  var WS_&quot; + .CompID + &quot; = null;\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;  //var WS_Con_&quot; + .CompID + &quot; = false;\n&quot;' />
						</command>
						<command class_type='comment' title='' comment='Comment' textarea='12,0,12,0' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;  function WS_Listeners_&quot; + .CompID + &quot;()\n  {\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;    WS_&quot; + .CompID + &quot;.addEventListener(&apos;open&apos;, window[&apos;WS_Open_&quot; + .CompID + &quot;&apos;]);\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;    WS_&quot; + .CompID + &quot;.addEventListener(&apos;close&apos;, window[&apos;WS_Close_&quot; + .CompID + &quot;&apos;]);\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;    WS_&quot; + .CompID + &quot;.addEventListener(&apos;message&apos;, window[&apos;WS_Msg_&quot; + .CompID + &quot;&apos;]);\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;    WS_&quot; + .CompID + &quot;.addEventListener(&apos;error&apos;, window[&apos;WS_Err_&quot; + .CompID + &quot;&apos;]);\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;  }\n&quot;' />
						</command>
						<command class_type='comment' title='' comment='Comment' textarea='12,0,12,0' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;  function WS_Open_&quot; + .CompID + &quot;()\n  {\n&quot;' />
						</command>
						<command class_type='decision' title='Decision' exp='bDebug' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.HeaderScript = .HeaderScript + &quot;    console.log(\&quot;WebSocket opened\&quot;);\n&quot;' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Decision' exp='Length$(macOnOpen) &gt; 0' swap='0' >
							<flowline >
								<command class_type='sim' title='Built-in Function' macro='Component.Property.GetValue' >
									<return exp='.sMacro' />
									<argument exp='this' />
									<argument exp='&quot;macOnOpen&quot;' />
								</command>
								<command class_type='sim' title='Built-in Function' macro='Component.GetParent' >
									<return exp='.hParent' />
									<argument exp='this' />
								</command>
								<command class_type='sim' title='Built-in Function' macro='Expand.MacroName' >
									<return exp='.sMacro' />
									<argument exp='.sMacro' />
									<argument exp='.hParent' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.HeaderScript = .HeaderScript + &quot;    &quot; + .sMacro + &quot;();\n&quot;' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;  }\n&quot;' />
						</command>
						<command class_type='comment' title='' comment='Comment' textarea='12,0,12,0' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;  function WS_Close_&quot; + .CompID + &quot;(ev)\n  {\n&quot;' />
						</command>
						<command class_type='decision' title='Decision' exp='bDebug' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.HeaderScript = .HeaderScript + &quot;    console.log(\&quot;WebSocket closed (\&quot; + ev.code + \&quot;): \&quot; + ev.reason);\n&quot;' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Decision' exp='Length$(macOnClose) &gt; 0' swap='0' >
							<flowline >
								<command class_type='sim' title='Built-in Function' macro='Component.Property.GetValue' >
									<return exp='.sMacro' />
									<argument exp='this' />
									<argument exp='&quot;macOnClose&quot;' />
								</command>
								<command class_type='sim' title='Built-in Function' macro='Component.GetParent' >
									<return exp='.hParent' />
									<argument exp='this' />
								</command>
								<command class_type='sim' title='Built-in Function' macro='Expand.MacroName' >
									<return exp='.sMacro' />
									<argument exp='.sMacro' />
									<argument exp='.hParent' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.HeaderScript = .HeaderScript + &quot;    &quot; + .sMacro + &quot;(ev.code, ev.reason, ev.wasClean);\n&quot;' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;  }\n&quot;' />
						</command>
						<command class_type='comment' title='' comment='Comment' textarea='12,0,12,0' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;  function WS_Msg_&quot; + .CompID + &quot;(ev)\n  {\n&quot;' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;    if (ev.data instanceof ArrayBuffer) {\n&quot;' />
						</command>
						<command class_type='decision' title='Decision' exp='bDebug' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.HeaderScript = .HeaderScript + &quot;      console.log(\&quot;WebSocket arraybuffer msg received\&quot;);\n&quot;' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Decision' exp='Length$(macOnReceiveArray) &gt; 0' swap='0' >
							<flowline >
								<command class_type='sim' title='Built-in Function' macro='Component.Property.GetValue' >
									<return exp='.sMacro' />
									<argument exp='this' />
									<argument exp='&quot;macOnReceiveArray&quot;' />
								</command>
								<command class_type='sim' title='Built-in Function' macro='Component.GetParent' >
									<return exp='.hParent' />
									<argument exp='this' />
								</command>
								<command class_type='sim' title='Built-in Function' macro='Expand.MacroName' >
									<return exp='.sMacro' />
									<argument exp='.sMacro' />
									<argument exp='.hParent' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.HeaderScript = .HeaderScript + &quot;      const uint8arr = new Uint8Array(ev.data);\n&quot;' />
									<exp exp='.HeaderScript = .HeaderScript + &quot;      &quot; + .sMacro + &quot;(uint8arr, ev.data.byteLength, ev);\n&quot;' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;    } else {\n&quot;' />
						</command>
						<command class_type='decision' title='Decision' exp='bDebug' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.HeaderScript = .HeaderScript + &quot;      console.log(\&quot;WebSocket string msg received\&quot;);\n&quot;' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Decision' exp='Length$(macOnReceiveString) &gt; 0' swap='0' >
							<flowline >
								<command class_type='sim' title='Built-in Function' macro='Component.Property.GetValue' >
									<return exp='.sMacro' />
									<argument exp='this' />
									<argument exp='&quot;macOnReceiveString&quot;' />
								</command>
								<command class_type='sim' title='Built-in Function' macro='Component.GetParent' >
									<return exp='.hParent' />
									<argument exp='this' />
								</command>
								<command class_type='sim' title='Built-in Function' macro='Expand.MacroName' >
									<return exp='.sMacro' />
									<argument exp='.sMacro' />
									<argument exp='.hParent' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.HeaderScript = .HeaderScript + &quot;      &quot; + .sMacro + &quot;(ev.data, ev);\n&quot;' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;    }\n  }\n&quot;' />
						</command>
						<command class_type='comment' title='' comment='Comment' textarea='12,0,12,0' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;  function WS_Err_&quot; + .CompID + &quot;(ev)\n  {\n&quot;' />
						</command>
						<command class_type='decision' title='Decision' exp='bDebug' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.HeaderScript = .HeaderScript + &quot;    console.log(\&quot;WebSocket error: \&quot;, ev);\n&quot;' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Decision' exp='Length$(macOnError) &gt; 0' swap='0' >
							<flowline >
								<command class_type='sim' title='Built-in Function' macro='Component.Property.GetValue' >
									<return exp='.sMacro' />
									<argument exp='this' />
									<argument exp='&quot;macOnError&quot;' />
								</command>
								<command class_type='sim' title='Built-in Function' macro='Component.GetParent' >
									<return exp='.hParent' />
									<argument exp='this' />
								</command>
								<command class_type='sim' title='Built-in Function' macro='Expand.MacroName' >
									<return exp='.sMacro' />
									<argument exp='.sMacro' />
									<argument exp='.hParent' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.HeaderScript = .HeaderScript + &quot;    &quot; + .sMacro + &quot;(ev);\n&quot;' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;  }\n&quot;' />
						</command>
						<command class_type='comment' title='' comment='Comment' textarea='12,0,12,0' />
						<command class_type='calculation' title='Set return to zero to ensure text is added to html file' >
							<exp exp='.Return = 0' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='27e0f9bc-4ddb-4365-9f90-97a7f0943b58' vmin='0' vmaj='1' codename='WebDevLibraryComponent1' panelId='0' x='60' y='-50' z='0' xsz='25' ysz='25' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='2' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Title::sText' data='Websocket
Client' />
					<value target='Name' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' >
		<background rgb='7292207' img='' style='0' />
		<camera xe='0' ye='0' ze='755.794' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<viewport dx='642' dy='1101' zoom='102.782' fix_topleft='0' />
		<page x='1000' y='1000' show='0' rgb='7360576' />
		<winpos ID='7005' RectRecentFloat='1270,288,1920,738' RectRecentDocked='0,0,642,1124' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='0' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='0' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='1' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='0' />
		<camera xe='0' ye='0' ze='781.66' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey0 xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey1 xe='-3.67394e-14' ye='0' ze='-300' xt='0' yt='0' zt='0' xquat='0' yquat='1' zquat='0' wquat='6.12323e-17' />
		<camerakey2 xe='0' ye='-300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.707107' yquat='0' zquat='0' wquat='0.707107' />
		<camerakey3 xe='-3.67394e-14' ye='300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-4.32978e-17' yquat='0.707107' zquat='0.707107' wquat='4.32978e-17' />
		<camerakey4 xe='-300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='0.5' zquat='0.5' wquat='0.5' />
		<camerakey5 xe='300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='-0.5' zquat='-0.5' wquat='0.5' />
		<camerakey6 xe='-173.205' ye='-173.205' ze='173.205' xt='0' yt='0' zt='0' xquat='-0.424708' yquat='0.17592' zquat='0.339851' wquat='0.820473' />
		<winpos ID='7004' RectRecentFloat='0,630,650,1080' RectRecentDocked='0,0,308,450' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='0' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='0' />
	</panel3d>
	<panels2d count='1' >
		<panel2d_0 id='0' name='NewPanel' type='0' >
			<winpos ID='1171' RectRecentFloat='681,519,1378,870' RectRecentDocked='1224,141,1866,1265' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='1' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='1' />
			<background fill='288230376151053813' showgrid='1' gridstyle='1' gridsize='10' gridbrush='71776119075691740' snaptogrid='1' fitcomp='0' disp_x='300' disp_y='400' scale='100' disp_col='16777215' />
		</panel2d_0>
	</panels2d>
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAtgUAAF8EAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Connect' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAtgUAAF8EAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Disconnect' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAtgUAAF8EAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Ev_HtmlScriptHeader' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAtgUAAF8EAAA' zoom='100' scrollx='0' scrolly='1041' flags='0' />
		<view type='0' name='SendString' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAtgUAAF8EAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='GetState' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAtgUAAF8EAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
