%% 
%% $Revision: 1.1.6.2 $
%% 
%%
%% Copyright 1994-2003 The MathWorks, Inc.
%%
%% Abstract: Bus creator block target file

%implements BusCreator "C"

%% Function: BlockInstanceSetup ==============================================
%% Abstract:
%%   Set expression folding compliance
%%
%function BlockInstanceSetup(block, system) void
%<LibBlockSetIsExpressionCompliant(block)>
%endfunction


%% Function: Outputs ==========================================================
%% Abstract:
%%
%function Outputs(block, system) Output
  %assign y = LibBlockOutputSignal(0, "", "", 0)
  %assign sType = LibBlockOutputSignalDataTypeId(0)
  %assign sName = LibGetDataTypeNameFromId(sType)
  %assign numElements = LibDataTypeNumElements(sType)
  %foreach idx = numElements
    %assign elemName = LibDataTypeElementName(sType, idx)
    %assign elemWidth = LibBlockInputSignalWidth(idx)
    %if LibBlockInputSignalIsComplex(idx)
      %assign elemWidth = elemWidth * 2
    %endif
    %if elemWidth == 1
      %assign u = LibBlockInputSignal(idx, "", "", 0)
      %<y>.%<elemName> = %<u>;
    %else
      %assign u = LibBlockInputSignalAddr(idx, "", "", 0)
      %assign eTypeName = LibGetDataTypeNameFromId(...
	LibDataTypeElementDataTypeId(sType, idx))
      (void) memcpy(&(%<y>.%<elemName>), %<u>, %<elemWidth>*sizeof(%<eTypeName>));
    %endif
  %endforeach
%endfunction


%% [EOF] buscreate.tlc
