Так делать можно( на горячую подменять пул и его размер), если нельзя, то как правильно?
Код:
CASE( PoolType)OF
  0:
    OWPool(
      ENABLE := TRUE,
      Count :=  5,(*( SIZEOF( ScanParams)/SIZEOF( ScanParams[ 0])),*)
      Pool := ADR( ScanParams[ 0]),
      IsListen := FALSE,
      ComHandle := Settings.Port);

  8..14:
    OWPool(
      ENABLE := TRUE,
      Count :=  3,
      Pool := ADR( ScanParams[ 5]),
      IsListen := FALSE,
      ComHandle := Settings.Port);
    IF( ScanParams[ 5].Complete)THEN PoolType := PoolType OR 1;END_IF
    IF( ScanParams[ 6].Complete)THEN PoolType := PoolType OR 2;END_IF
    IF( ScanParams[ 7].Complete)THEN PoolType := PoolType OR 4;END_IF
    RETURN;

  15:
    OWPool(
      ENABLE := TRUE,
      Count :=  1,
      Pool := ADR( ScanParams[ 8]),
      IsListen := FALSE,
      ComHandle := Settings.Port);
    IF( ScanParams[ 8].Complete)THEN PoolType := 0;END_IF
    RETURN;

ELSE
    task_Main_ERROR( info := 'óïñ...task_Comm_RS_485_1');
    RETURN;

END_CASE;