//This file was generated by the LASAL2 CodeGenerator  -- 
//Please, do not edit this file (it might be overwritten by the next generator run)
//{{LSL_DECLARATION

(*!
<Class
	Name               = "SdiasHubBase"
	Revision           = "1.10"
	GUID               = "{5633D4A6-9129-4E1C-BB50-7F012CD8443A}"
	RealtimeTask       = "false"
	CyclicTask         = "false"
	BackgroundTask     = "false"
	Sigmatek           = "true"
	OSInterface        = "false"
	HighPriority       = "false"
	Automatic          = "false"
	UpdateMode         = "Prescan"
	IconPath           = ".\Class\Tool.ico"
	SharedCommandTable = "true"
	Objectsize         = "(410,120)">
	<Channels>
		<Server Name="ClassSvr" GUID="{0209BB79-9907-4B31-8B89-7642238DF9F5}" Visualized="false" Initialize="false" WriteProtected="true" Retentive="false" Comment="Connect a SDIAS Client Class"/>
		<Client Name="SplitterPlace" Required="true" Internal="false" Comment="Place of this Splitter"/>
		<Client Name="ToNextSDIAS" Required="true" Internal="false" Comment="Connect to first server of SDIAS Manager or Client"/>
	</Channels>
	<RevDoku>
		<Owner Company="Sigmatek" Author="RamAnd"/>
		<Dokumentation Revision="1.10" Date="01.08.2013" Author="ObeChr" Company="Sigmatek" Description="Comments for Server / Client"/>
		<Dokumentation Revision="1.0" Date="18.07.2013" Author="RamAnd" Company="Sigmatek" Description="First library version"/>
	</RevDoku>
</Class>
*)
SdiasHubBase : CLASS
  //Servers:
	ClassSvr 	: SvrChCmd_DINT;
  //Clients:
	ToNextSDIAS 	: CltChCmd_t_e_VaranErrors;
	SplitterPlace 	: CltCh_DINT;
  //Variables:
  //Functions:
	
	FUNCTION VIRTUAL GLOBAL ClassSvr::NewInst
		VAR_INPUT
			pPara 	: ^CmdStruct;
			pResult 	: ^results;
		END_VAR
		VAR_OUTPUT
			ret_code 	: iprStates;
		END_VAR;
  //Tables:
	FUNCTION @STD
		VAR_OUTPUT
			ret_code	: CONFSTATES;
		END_VAR;
	FUNCTION GLOBAL TAB @CT_;
END_CLASS;

//}}LSL_DECLARATION


FUNCTION GLOBAL TAB SdiasHubBase::@CT_
0$UINT,
2#0100000000000000$UINT, //TY_SDIASHUBBASE
1$UINT, 10$UINT, (SIZEOF(::SdiasHubBase))$UINT, 
1$UINT, 2$UINT, 0$UINT, 
TO_UDINT(4173303375), "SdiasHubBase", //Class
TO_UDINT(0), 0, 0$UINT, 0$UINT, //Baseclass
//Servers:
(::SdiasHubBase.ClassSvr.pMeth)$UINT, _CH_CMD$UINT, 2#0000000000000000$UINT, TO_UDINT(619352855), "ClassSvr", 
//Clients:
(::SdiasHubBase.ToNextSDIAS.pCh)$UINT, _CH_CLT_CMD$UINT, 2#0000000000000010$UINT, TO_UDINT(869730430), "ToNextSDIAS", 
(::SdiasHubBase.SplitterPlace.pCh)$UINT, _CH_CLT_DATA$UINT, 2#0000000000000010$UINT, TO_UDINT(3581843575), "SplitterPlace", 
END_FUNCTION


#define USER_CNT_SdiasHubBase 0

TYPE
	_LSL_STD_VMETH	: STRUCT
			CmdTable	: CMDMETH;
			UserFcts	: ARRAY[0..USER_CNT_SdiasHubBase] OF ^Void;
	END_STRUCT;
END_TYPE

FUNCTION SdiasHubBase::@STD
	VAR_OUTPUT
		ret_code	: CONFSTATES;
	END_VAR
	VAR
		vmt	: _LSL_STD_VMETH;
	END_VAR

	//Command Methods
	InitCmdTable (nCmd := nSTDCMD + USER_CNT_SdiasHubBase, pCmd := #vmt.CmdTable);
	vmt.CmdTable.NewInstr		:= #NewInst();
	ClassSvr.pMeth		:= StoreCmd (pCmd := #vmt.CmdTable, SHARED);

	IF ClassSvr.pMeth THEN
		ret_code	:= C_OK;
	ELSE
		ret_code	:= C_OUTOF_NEAR;
		RETURN;
	END_IF;

END_FUNCTION

//{{LSL_IMPLEMENTATION


FUNCTION VIRTUAL GLOBAL SdiasHubBase::ClassSvr::NewInst
	VAR_INPUT
		pPara 	: ^CmdStruct;
		pResult 	: ^results;
	END_VAR
	VAR_OUTPUT
		ret_code 	: iprStates;
	END_VAR

  // use last parameter for port number
  pPara^.aPara[MAXCMDPARA-1] := SplitterPlace;

	ret_code := ToNextSDIAS.NewInst(pPara, pResult);

END_FUNCTION
