Get System Value (GSV) and Set System Value (SSV)
This information applies to the
CompactLogix
5370, ControlLogix
5570, Compact GuardLogix
5370, GuardLogix
5570, Compact GuardLogix
5380, CompactLogix
5380, CompactLogix
5480, ControlLogix
5580, and GuardLogix
5580 controllers.he GSV/SSV instructions get and set controller system data that is stored in objects.
IMPORTANT:
The SSV attributes must be uploaded to be saved to the project.
Available Languages
Ladder Diagram
Function Block
These instructions are not available in function block.
Structured Text
GSV(ClassName,InstanceName,AttributeName,Dest)
SSV(ClassName,InstanceName,AttributeName,Source)
Operands
There are data conversion rules for mixed data types within an instruction. See Data Conversion.
Ladder Diagram and Structured Text
Operand | Type | Format | Description |
---|---|---|---|
Class name | name | The name of object class | |
Instance name | name | The name of specific object, when object requires name | |
Attribute name | name | The attribute of object The data type depends on the attribute you select | |
Destination (GSV) | SINT INT DINT REAL structure TIME32 TIME DT LDT | tag | The destination for attribute data |
Source (SSV) | SINT INT DINT REAL structure TIME32 TIME LTIME DT LDT | tag | The tag that contains data you want to copy to the attribute |
TIP:
See Time and date data types for a complete description of Relative Time (LTIME, TIME, and TIME32) and Absolute Time (LDT and DT) data types.
TIP:
When you use the GSV Instruction with the WallClock class and the CSTOffset attribute with the TIME32 data type, you must create the TIME32 data type tag a TIME32[2] array tag.
Description
The GSV/SSV instructions get and set controller status data that is stored in objects. The controller stores status data in objects. There is no status file, as in the PLC-5 processor.
When true, the GSV instruction retrieves the specified information and places it in the destination. When true, the SSV instruction sets the specified attribute with data from the source.
When you enter a GSV/SSV instruction, the programming software displays the valid object classes, object names, and attribute names for each instruction. For the GSV instruction, you can get values for all the attributes. For the SSV instruction, the software displays only those attributes you can set (SSV).
NOTE:
CAUTION:
Use the SSV instructions carefully. Making changes to objects can cause unexpected controller operation or injury to personnel.You must test and confirm that the instructions do not change data that you do not want to change.
The SSV instructions write and the GSV instructions read past a member into other members of a tag. If the tag is too small, the instructions do not write or read the data. They log a minor fault instead.
Example 1
Member_A is too small for the attribute. So the GSV instruction writes the last value to Member_B.
Example 2
My_Tag is too small for the attribute. So the GSV instruction stops and logs a minor fault. The Destination tag remains unchanged.
GSV/SSV Objects define each object’s attributes and their associated data types. For example, the MajorFaultRecord attribute of the Program object requires a DINT[11] data type.
Affects Math Status Flags
No.
Major/Minor Faults
A minor fault will occur if: | Fault Type | Fault Code |
---|---|---|
There is an invalid object address | 4 | 5 |
The specified object that does not support GSV/SSV | 4 | 6 |
There is an invalid attribute | 4 | 6 |
There was not enough information supplied for an SSV instruction | 4 | 6 |
The GSV destination was not large enough to hold the requested data | 4 | 7 |
See Common Attributes for operand-related faults.
Execution
Ladder Diagram
Condition | Action Taken |
---|---|
Prescan | N/A |
Rung-condition-in is false | N/A |
Rung-condition-in is true | The instruction executes. |
Postscan | N/A |
Structured Text
Condition | Action Taken |
---|---|
Prescan | See Prescan in the Ladder Diagrams table. |
Normal Execution | See rung-condition-in is true in the Ladder Diagrams table. |
Postscan | See Postscan in the Ladder Diagrams table. |
Example
Ladder Diagrams
Structured Text
GSV (Program,THIS,LASTSCANTIME,dest1);
SSV (Program, THIS, MinorFaultRecord, src[0]);
Provide Feedback