In this section we will present basic info about Function Block logic elements. More details can be found in Rockwell Publication 1756-RM084Z-EN-P.


Available logic elements in Studio 5000 and their L5X node names:


L5X ItemStudio 5000 Element
IRefInput Reference
ORefOutput Reference
IConInput Wire Connector
OConOutput Wire Connector
BlockFunction Block Instruction
AddOnInstruction
Add-On Instruction
JSR
Jump to Subroutine Instruction
SBR
Subroutine Instruction
RETReturn Instruction
WireWire and its corresponding attachments
FeedbackWire
Feedback wire and its corresponding attachments
Function
Function block function
TextBox
Text box
Attachment
Attachment from a text box to another function block element


Here is an example of a simple logic element definition:

var inputWireConn = {
          element: "ICon",
          ID: "123",
          Name: "newIWConn",
          X: "910",
          Y: "120"};
console.log(inputWireConn.ID) // -> "123"
inputWireConn.ID = 222;
console.log(inputWireConn.ID) // -> "222"


IRefInput Reference


AttributeDescription
ID32bit unsigned integer value. Must be unique within the given sheet
XX coordinate on the sheet
YY coordinate on the sheet
OperandFunction block instruction
HideDesc
Whether or not to hide the description (true or false)

ORefOutput Reference


AttributeDescription
ID32bit unsigned integer value. Must be unique within the given sheet
XX coordinate on the sheet
YY coordinate on the sheet
OperandFunction block instruction
HideDesc
Whether or not to hide the description (true or false)

IConInput Wire Connection


AttributeDescription
ID32bit unsigned integer value. Must be unique within the given sheet
XX coordinate on the sheet
YY coordinate on the sheet
Name(optional) Name of wire connector

OCon
Output Wire Connector


AttributeDescription
ID32bit unsigned integer value. Must be unique within the given sheet
XX coordinate on the sheet
YY coordinate on the sheet
Name(optional) Name of wire connector

Block
Function Block Instruction


AttributeDescription
TypeThe type of Block. Specify the mnemonic name for the block (for example “BAND”)
ID32bit unsigned integer value. Must be unique within the given sheet
XX coordinate on the sheet
YY coordinate on the sheet
OperandBlock tag name
VisiblePinsList of the names of all the parameters with pins visible for wiring (separated with spaces). The names should match the member names on the block tag.
AutoTuneTagTag name for the autotune tag (Rockwell does not list it as optional but it is optional for blocks that do not need it);
HideDesc
Whether or not to hide the description (true or false)


This block may contain an array of objects “Array” with the following structure:


AttributeDescription
NameOperand Function
Operand
Operand Tag


This array is only needed for special instructions. You can leave it empty for all other instructions.

Example of Block definition with Array needed:


var block = {
          element: "Block",
          Type: "MAVE",
          ID: "123",
          X: "120",
          Y: "80",
          Operand: "MAVE_01",
          VisiblePins:"In Out",
          HideDesc:"false",
          Array: [
               {Name:"StorageArray", Operand:"storeTag"},
               {Name:"WeightArray", Operand:"weightTag"}
          ]
};
console.log(block.ID) // -> "123"
block.ID = 222;
console.log(block.ID) // -> "222"
console.log(block.Array[0].Operand) // -> "storeTag"
block.Array[0].Operand = "anotherTag";
console.log(block.Array[0].Operand) // -> "anotherTag"


Representation in Studio 5000:





AddOnInstructionAdd-On Instruction


AttributeDescription
NameName of Add-On Instruction
ID32bit unsigned integer value. Must be unique within the given sheet
XX coordinate on the sheet
YY coordinate on the sheet
OperandAOI tag name
VisiblePins
Whether or not to hide the description (true or false)
List of the names of all the parameters with pins visible for wiring (separated with spaces). The names should match the member names on the block tag. InOutParameter should be listed.


This block may contain an array of objects “InOutParameter” with the following structure:


AttributeDescription
NameInOutParameter Name
ArgumentInOutParameter Tag


This array is only needed if InOutParameters are used. You can leave it empty for all other instructions.

Example of AOI definition with Array needed:


var AOIinst = {
          element: "AddOnInstruction",
          Name: "SomeAOI",
          ID: "123",
          X: "120",
          Y: "80",
          Operand: "AOITag1",
          VisiblePins:"Input1 Output1 InOutParam1 InOutParam2",
          InOutParameter: [
               {Name:"InOutParam1", Argument:"tag1"},
               {Name:"InOutParam2", Argument:"tag2"}
          ]
};
console.log(AOIinst.ID) // -> "123"
AOIinst.ID = 222;
console.log(AOIinst.ID) // -> "222"
console.log(AOIinst.InOutParameter[0].Argument) // -> "tag1"
AOIinst.InOutParameter[0].Argument = "anotherTag";
console.log(AOIinst.InOutParameter[0].Argument) // -> "anotherTag"

Representation in Studio 5000:



JSR
Jump to Subroutine Instruction


AttributeDescription
ID32bit unsigned integer value. Must be unique within the given sheet
XX coordinate on the sheet
YY coordinate on the sheet
RoutineRoutine name
In
Input parameters (separated with spaces)
RetReturn parameters (separated with spaces)

SBR
Subroutine Instruction


AttributeDescription
ID32bit unsigned integer value. Must be unique within the given sheet
XX coordinate on the sheet
YY coordinate on the sheet
RoutineRoutine name
Ret
Return parameters (separated with spaces)

RET
Return Instruction


AttributeDescription
ID32bit unsigned integer value. Must be unique within the given sheet
XX coordinate on the sheet
YY coordinate on the sheet
RoutineRoutine name
In
Input parameters (separated with spaces)

Wire
Wire and its corresponding Attachments


AttributeDescription
FromID32bit unsigned integer value of source element ID
FromParamParameter name on the source element.(“In” for IRef and ICon)
ToID32bit unsigned integer value of destination element ID
ToParamParameter name on the destination element.(“Out” for ORef and OCon)

FeedbackWire
Feedback Wire and its corresponding Attachments


AttributeDescription
FromID32bit unsigned integer value of source element ID
FromParamParameter name on the source element.(“In” for IRef and ICon)
ToID32bit unsigned integer value of destination element ID
ToParamParameter name on the destination element.(“Out” for ORef and OCon)

Function
Function Block Function


AttributeDescription
Type
The type of Block. Specify the mnemonic name for the block (for example “ADD”)
ID32bit unsigned integer value. Must be unique within the given sheet
XX coordinate on the sheet
YY coordinate on the sheet

TextBox
Text Box


AttributeDescription
ID32bit unsigned integer value. Must be unique within the given sheet
XX coordinate on the sheet
YY coordinate on the sheet
WidthBlock width (is not supported in all versions)
Text
Text to be displayed

Attachment
Attachment from a Text Box to another Block Element


AttributeDescription
FromID
32bit unsigned integer value of ID of the attached object
ToID
32bit unsigned integer value of destination element ID


Note:

All attachment blocks must come after all text box blocks in l5x