Setting keys via CNC objects

The keys for encryption groups must be set via CNC objects. Refer to the example below on how to address objects via the index group and index offset.

You can also set them online using the ISG Object Browser of the CNC.

As a security measure, all keys are only displayed hidden.

Access to encryption

All groups are accessible as shown below. The arrays can only be written via CNC objects.

Example

Channel 1

Task: COM

IDXGRP     :=16#00120101  ( Channel 1 )
IDXOFFS    :=16#00000094  ( mc_encryption_key_0)
IDXGRP     :=16#00120101  ( Channel 1 )
IDXOFFS    :=16#00000095  ( mc_encryption_key_1)
IDXGRP     :=16#00120101  ( Channel 1 )
IDXOFFS    :=16#00000096  ( mc_encryption_key_2)

ADS function block

Transfer takes place using the function block ADSWRITE(). The following applies to the example above:

fb_AdsWrite( NETID   :='',
             PORT    :=553,
             IDXGRP  :=16#00120101,
             IDXOFFS :=16#00000094,
             SRCADDR := ADR(mc_encryption_key_0),
             LEN     := SIZEOF (mc_encryption_key_0),
             WRITE   := TRUE

);

Notice

When writing CNC objects, note that it may be necessary to insert a "\0" at the string end.