# SLAC Configuration

Avitar can be used to configure a PLC device as either a normal PLC station or a SLAC PEV-PLC or SLAC EVSE-PLC station. In doing so, Avitar changes several PIB values at the same time. This section illustrates how to configurat a PIB the same way using the toolkit.

The HomePlug Green PHY Specification refers to the `APCM_SET_CCO.REQ` and `APCM_CONF_SLAC` primatives in the SLAC protocol description. These are virtual operations to be implemented by the user. In both cases, one must read the PIB from the PLC device, edit the PIB, recompute PIB checksums and write the PIB back to the PLC device. This can be done manually, using Avitar, or in a script, using the Powerline Toolkit as shown below, or programatically, using custom software.

## PEV-PLC PIB Settings

OFFSET | LENGTH | SYMBOL | DESCRIPTION
--- | --- | --- | ---
0000F4 | 1 | CCoSelection | 1: This sets CCo Selection to Never;
001653 | 1 | SLAC_EnableMode | 1: This sets SLAC Selection to PEV;
001C98 | 4 | LowLinkSpeed_kbps | 10240
001C9C | 4 | HighLinkSpeed_kbps | 102400

The following shell script converts a factory PIB to a SLAC PEV by setting the CCO Mode to Never and the SLAC Mode to PEV. The User HFID is set to PEV for role identification, optionally. This PIB must be written into PEV-PLC flash memory for proper operation.

    #!/bin/sh
    # file: pev.sh
    # ========================================================================
    # convert a factory PIB to a SLAC PEV PIB by changing these PIB settings;
    # ------------------------------------------------------------------------
    setpib ${1} 74 hfid "PEV"
    setpib ${1} F4 byte 1
    setpib ${1} 1653 byte 1
    setpib ${1} 1C98 long 10240 long 102400

## PEV-EVSE PIB Settings

OFFSET | LENGTH | SYMBOL | DESCRIPTION
--- | --- | --- | ---
0000F4 | 1 | CcoSelection | 2: This sets CCo Mode to Always;
001653 | 1 | SLAC_EnableMode | 2: This sets SLAC Mode to EVSE;
001C98 | 4 | LowLinkSpeed_kbps | 10240
001C9C | 4 | HighLinkSpeed_kbps | 102400

The following shell script converts a factory PIB to a SLAC EVSE by setting the CCO Mode to Always and the SLAC Mode to EVSE. The User HFID is set to EVSE for role identification, optionally. This PIB must be written into EVSE-PLC flash memory for proper operation.

    #!/bin/sh
    # file: evse.sh
    # ========================================================================
    # convert a factory PIB to a SLAC EVSE PIB by changing these PIB settings;
    # ------------------------------------------------------------------------
    setpib ${1} 74 hfid "EVSE"
    setpib ${1} F4 byte 2
    setpib ${1} 1653 byte 2
    setpib ${1} 1C98 long 10240 long 102400

## APCM_SET_CCO Primative

This primative configures a PLC state by reading PIB from PLC, changing CCoSelection, computing new PIB checksum then writing the PIB back to PLC. It can be performed manually using Avitar, in a script using the Powerline Toolkit or programatically using custom software.

## APCM_CONFIG_SLAC Primative