Using Application Specific Tag on an IO-Link Device in Rockwell Studio 5000
1. Prerequisite
Balluff Black or Silver Line Ethernet/IP IO-Link master is powered and configured for IO-Link communications. An IO-Link device is plugged into Port 1 on the Balluff Ethernet/IP master module. The IO-Link device's IODD description file is loaded onto the Balluff Ethernet/IP master module's webserver. LED on the Ethernet/IP master module is solid green, showing IO-Link communications between the IO-Link device and the Balluff Ethernet/IP master module.
2. Background
In IO-Link, the Application Specific Tag is a user-defined identifier stored in the IO-Link device to describe how that device is used in an application. The application specific tag can have data programmed in and read back out per the application requirements. The application specific tag is addressed to an Index and Sub-index location within the IO-Link Identification data. This is located in Index 24 decimal and Sub-index 0. The application specific tag normally has a default value of all zeroes and can be up to 32 bytes long. The application specific tag values can be read and written to via the Balluff IO-Link master web server, when the port of the IO-Link device is selected under ISDU Parameter as shown below. The data is shown in hexadecimal.

Otherwise, once the IO-Link device's IODD file is loaded onto the Balluff IO-Link master module, the ISDU-Parameter (IODD) tab shows the application specific tag under the Identification tab. The data shown here when read is in ASCII format.

3. Using Message (MSG) Instruction in Logix 5000 to Read Application Specific Tag
- Determine location and trigger for MSG Instruction. MSG Instructions must be not cyclically sent to the Ethernet master block. This will lock up the module once there are too many messages in the Ethernet block's Que. The trigger can be setup as a one shot, via a push button, or when the application tag needs to be read.

- Create Message Tag. Right click on "?" and choose "New Tag"

- Create two controller tags, "Parameter_Read" and "Parameter_Data" with Data Type as 'SINT[50]'.

- Click on the Ellipse button on the MSG instruction.

- Set the following in the MSG Instruction
- Message Type: CIP Generic
- Service Type: Custom
- Service Code: 32
- Class: 96
- Instance: 1-8 (dependent on IO-Link port number)
- Attribute: 3 (3 =Read Parameter, 2 = Write Parameter)
- Source Length: 3

- For the Source Element, select ‘Parameter_Read[0]’. The Source Length will be 3 bytes. The Destination Element will be ‘Parameter_Data[0]' tag. This will be where the application data will be stored once read.

- Click on the Communication tab.

- Click the "Browse" button and choose the Ethernet IO-Link master that the IO-Link device for the application data tag is attached to. Click OK to select.

- Complete the MSG Instruction configuration by click on the "OK".

- In the Logix 5000 tag window find the Source tag assigned to the MSG instruction. In this example, it was the 'Parameter_Read' tag. Go to the 'Monitor' tab for the tag. Enter the values for the tag. The first array element will be the Application Specific tag Index. Element 1 will be the Sub Index High byte. Element 2 will be the Sub Index Low byte.

- Save and Upload these values into the PLC. Perform a download to the PLC. Simulate trigger of the MSG instruction to verify the functionality. The 'Toggle_Read' bit will execute the MSG instruction once. Afterwards, the 'DN' bit of the MSG instruction will indicate the message was executed successfully.

- The returned value of the Application Specific tag will be stored in the 'Parameter_Data' tag array. The application specific tag values of 32 bytes is returned starting at 'Parameter_Data[1]' This data can be read as decimal, hex or ASCII depending on the format selected. When read as ASCII, it would match up to the data shown on the webserver when the ISDU-Parameter (IODD) tab was selected.


4. Using Message (MSG) Instruction in Logix 5000 to Write to Application Specific Tag
- Setup a trigger for the write MSG instruction. MSG instructions must not be cyclically sent to the Balluff Ethernet/IP master module. This will lock up the module once there are too many mesage in the Ethernet module's Que. The trigger can be setup as a one-shot, via a push button only when the application specific tag needs to be written to the IO-Link device.

- Create a Message tag for the MSG instruction and name it 'Write_Parameter'.
- Create a controller tag, "Parameter_Write' with Data Type as 'SINT[50]'.

- Click on the ellipse button on the Write_Parameter MSG instruction.

-
Set the following in the MSG Instruction
- Message Type: CIP Generic
- Service Type: Custom
- Service Code: 32
- Class: 96
- Instance: 1-8 (dependent on IO-Link port number)
- Attribute: 2 (2 = Write Parameter)
- Source Length: 35

- For the Source Element, select ‘Parameter_Write[0]’. The Source Length will be 35 bytes. The Destination Element will be the returned data byte for success or error code under the ‘Parameter_Data[40]' tag.
- Click on the 'Communications' tab.

- Click the "Browse…" button and choose the Balluff Ethernet IO-Link Master that the IO-Link device is attached to, and Click "OK".

- Complete the MSG Instruction configuration by clicking the "OK" button.

- In the Logix 5000 tag window find the Source tag assigned to the MSG Instruction. In this case, it was ‘Parameter_Write’. Go to the 'Monitor' tab. Change the Style in the first three bytes of the array to Decimal. Starting at array [3]..[35] the Style can be setup as ASCII since this is where the write data of the application data tag will start.

- Enter the values below. The application specific tag index goes into array element 0, with sub index being in array byte 1 and 2. The Application Specific Tag byte starts at array byte 3 up to the required bytes.
- Element [0]: 24 (Application Specific Tag Index)
- Element [1]: 0 (Sub Index High)
- Element [2]: 0 (Sub Index Low)
- Element [3]: A (Example of First Byte of Application Tag)
- Element [4]: B (Example of Second Byte of Application Tag)
- Element [5]: C (Example of Third Byte of Application Tag)
- Simulate trigger of MSG instruction, to verify functionality. The 'Toggle_Write' bit will execute the MSG instruction once. Afterwards, the 'DN' bit will indicate the message was executed successfully. If an error occurred, the 'ER' bit would be set. In that situation, double click on the button to see what the error is.

- Verification of the Application Specific Tag data can be done via toggling on the previous 'Toggle_Read' message instruction or via the web server of the Balluff Ethernet IO-Link module and reading the ISDU-Parameter (IODD) tab for the Application Specific tab.

