- Created by Jose Porto, last modified on Dec 21, 2021
- Translations
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 2 Next »
All project components such as tags, alarms, devices have associated classes and dot NET objects with properties and methods accessible by the system at runtime. See this section.
Runtime Project Objects
Or Action.NET has a structure supported by Object-Oriented programming, as already explained in the item "Object Model and Namespaces" . The documentation. NET for namespaces, following the MSDN layout, is accessible in http://www.spinengenharia.com.br/help/an-2016/runtime/index.html .
Classes do Microsoft .NET Framework
The Action.NET has access to all the features of the Microsoft dotNET Framework, such as a pure managed code application. For information about cas classes C# and VB.NET refer to Microsoft MSDN. Framework 4 Net online documentation at http:// msdn.microsoft.com/en-us/library/gg145045 (v=vs.100).aspx .
Script Toolkit
When creating script code within the Action.NET, you can use a set of public utility methods, which we call script toolkit. These methods are available in the TK namespace from any code within the project. The available methods are defined in http://www.spinengenharia.com.br/help/an-2016/runtime/index.html
Custom Keyboards on Screens
By using touchscreen panels, you can customize a keyboard already provided on Action.NET on screen. Or you can make a screen-keyboard of your own.. Contact us for source code examples about implementing custom keyboards.
WPF control toolkit
You can add any WPF control directly to Action.NET without the need for any additional tools. But if you want to have a custom configuration dialog by accessing the Tags in the application, you can use the WPF Controls Toolkit (WK) interfaces. Contact us for examples about creating WPF controls, or if you need help encapsulating Active-X or DOT NET controls to use them within Action.NET.
COM data access API
If you need to access the database in real time from external applications, using any programming language or even JavaScript code in web browsers, you can use the COM data access API, described in http:// www.spinengenharia.com.br/help/an-2016/runtime/index.html.
Driver Import Wizard and Toolkit
Action.NET has extensions to allow you to create your own communication drivers with devices (communication protocols) using the Driver Toolkit, as well as custom import tools and add-in components. Contact SPIN if you need information about these additional extensions.
Namespace Tag
All real-time project variables, or Project Tags, as they are commonly called on SCADA systems, are available in this Namespace. Tags are created in the interface Edit >Tags> Objects. For each tag a type is defined for its value. The available types are shown in "Predefined Tag Types" on page 94.
The syntax Tag. <TagName> is available for all tag types. To know the type of a particular tag you can access additional properties and methods using syntax:
Tag. <TagName>. <PropertyName>. The element TagObj shows properties and methods available for all tag types. On the other hand, Analog shows the properties common to all Analog tags (refers to the tag type for specific properties). User-created types (templates) are allowed in combination with predefined native types.
ClassTagObj
Base class for all tag objects.
ForceValue
Forces the value property of the object to be changed to the value given as a parameter. Example:
@Tag.AnalogInt1.ForceValue(10)(VB) @Tag.AnalogInt1.ForceValue(10);(C#)
Tostring
Returns a string that represents the current object. Example:
Dimsas string(VB) @Tag.AnalogInt1= 33
s=@Tag.AnalogInt1.Tostring();
strings;(C#) @Tag.AnalogInt1= 33;
s=@Tag.AnalogInt1.Tostring();
In this example, s will be evaluated as "33".
Alarm Disable
Returns or changes the disabled alarm state of the tag. If 0 (zero), the AlarmDisable property is not active. In the case of values other than 0 (zero), the
AlarmDisable becomes active. When the AlarmDisable property is not active, all alarms associated with the current tag are not handled. Example:
@Tag.AnalogInt1.AlarmDisable | = | 1st(VB) |
@Tag.AnalogInt1.AlarmDisable | = | 1;(C#) |
In this example, the alarms associated with the AnalogInt1 object will not be handled.
Alarm State
Returns or changes the alarm state of the tag. If 0 (zero): Out of alarm state. In the case of values other than 0 (zero): in alarm state. Example:
Dim alarmStateas Integer(VB) alarmState= @Tag.AnalogInt1.AlarmState intalarmState;(C#)
alarmState=@Tag.AnalogInt1.AlarmState;
GetName
Provides the name of the tag. It is ideal for setting the "target" of a reference tag. Example:
@Tag.ReferenceTagName.Link=@Tag.TagName.GetName()(VB) @Tag.ReferenceTagName.Link= @Tag.TagName.GetName();(C#)
Changed
Returns or changes the state of "there has been a change" in the tag value. True: Value has changed. False: Value has not changed.
Domain
Returns or changes the Domain property of the Tag. If 0 (zero): server. If 1: customer.
Units
Returns or changes the engineering units used to quantify the tag, as defined in its creation.
Format
Returns or changes the format of the tag value for display purposes.
Historian
Provides the HistoryItem object where the current tag is configured as tagname. If duplicate tags are allowed in historian tables, then the Historian will point to the last HistoryItem object where the current tag is configured as TagName. Example:
@Tag.AnalogInt.Historian.Deadband=5(VB) @Tag.AnalogInt.Historian.Deadband= 5;(C#)
Locked
Returns or changes the "locked" condition of the tag. When a tag is locked, the value used for processing originates from the LockValue and not the property Value.
If 0 (zero): unlocked. In the case of values other than 0 (zero): locked. Example:
@Tag.AnalogDouble1.Locked=1(VB) @Tag.AnalogDouble1.Locked= 1;(C#)
Quality
Returns or changes the quality state of the tag.
For quality, the codes defined by the OPC-DA standard are used. The two most common OPC quality codes are:
192 or Hex C0 is of good quality.
0 (decimal or hexadecimal) is of poor quality.
Several qualities in the OPC protocol standards are shown in the following table:
For more information, see the OPC specifications. (Note: Not all servers will support all of these codes.) Example:
@Tag.Digital1.Quality | = | 192(VB) |
@Tag.Digital1.Quality | = | 192;(C#) |
Retentive
Returns or changes the Retentive property of the tag. This property specifies whether the Tag Value should be saved when the application is terminated. The saved value is then used as the startup value when running the next application. If 0 (zero): non-retentive. In the case of values other than 0 (zero): retentive. Example:
@Tag.AnalogInt1.Retentive=1(VB) @Tag.AnalogInt1.Retentive= 1;(C#)
Timestamp
Returns or changes the Timestamp property of the tag, i.e. the date and time when the last change in the value or quality of the tag occurred. Example:
Dim dtAsDateTimeOffset(VB) dt = @Tag.AnalogInt1.Timestamp
DateTimeOffsetdt;(C#)
dt=@Tag.AnalogInt1.Timestamp;
ValueType
Returns the ValueType property of the tag. For each tag type, an int number is defined that represents this type. Numbers above 100 are reserved for UserTypes (templates). Example:
Dim doubleTypeAs Integer(VB) doubleType= @Tag.AnalogInt1.ValueType
intdoubleType;(C#)
doubleType=@Tag.AnalogInt1.ValueType;
Visibility
Returns or changes the visibility state of the tag. If 0 (zero): private, 1: protected, and 2: public. For the meaning of these values see in "Creating and Editing Tags" on page 91. Example:
Dim visibilityStateas Integer(VB) visibilityState= @Tag.AnalogInt1.Visibility
intvisibilityState;(C#)
visibilityState=@Tag.AnalogInt1.Visibility;
Class Digital
Runtime properties for Digital Class. Possible values: 0 = false and 1 = true. Equivalent types in the script:
•C#: int32
•VB: int
•.NET: int
Toogle
Toggles the tag value property between 0 (zero) and 1. If the current value is 0 (zero), then the new value is 1. If the current value is 1, then the new value is 0 (zero). Example:
DimnewValueasByte(VB)
newValue=@Tag.Digital1.ToggleValue()
bytenewValue;(C#)
newValue=@Tag.Digital1.ToggleValue();
LockValue
Returns or changes the LockedValue property of the tag. When a tag is locked, the value used for processing originates from the LockValue property and not from the Value property. It's an int32 example:
@Tag.Digital1.LockValue=1(VB) @Tag.Digital1.LockValue= 1;(C#)
State
Provides the state property of the digital tag. Value = 0 corresponds to state = False (VB) or state = false (C#). Value = 1 corresponds to state = True (VB) or state= true (C#).
Value
Returns or changes the Digital Tag Value property. Valid values: 0 (zero) or 1. Example:
@Tag.Digital1.Value=1(VB) @Tag.Digital1.Value= 1;(C#).
Class Analog
Runtime properties for Analog Class.
Bit0, Bit1,... Bit31
Returns or changes the state of the order bit 0.1,... 31 of the value of an AnalogInt.
Hi, HIHi, Lo LoLo
Return or change the value of the current Hi, HiHI, LO,LO LO limit of an Analog tag, any.
Class Analog<T>
Runtime properties for Analog Class <T>. These Analog-derived classes are defibnidas for each of the value types that can be used: AnalogInt, AnalogDecimal, AnalogDouble, AnalogLong.
Deadband
Returns or changes the dead band of the analog tag. Example:
@Tag.AnalogDouble1.Deadband=5(VB) @Tag.AnalogDouble1.Deadband= 5;(C#)
LockValue
Returns or changes the lock value of the analog tag. Example:
@Tag.AnalogDouble1.LockValue=50(VB) @Tag.AnalogDouble1.LockValue= 50;(C#)
Analog.Min and Analog.Max
Returns or changes the minimum or maximum value of the analog tag. Example:
@Tag.AnalogDouble1.Min = 120(VB) @Tag.AnalogDouble2.Min = 120;(C#)
@Tag.AnalogDouble3.Max = 120(VB) @Tag.AnalogDouble4.Max = 120;(C#)
StartValue
Returns or changes the initial value of the analog tag, which can be set at setup time in the TManager. Example:
@Tag.AnalogDouble1.StartValue=50(VB) @Tag.AnalogDouble1.StartValue= 50;(C#)
State
Returns or changes the state of the analog tag. If the value is equal to 0 (zero), the state is FALSE. If the value is different from 0 (zero), the state is TRUE. Example:
Dim state as Boolean(VB) state = @Tag.AnalogInt1.State bool state;(C#)
state=@Tag.AnalogInt1.State; @Tag.AnalogInt1.Value=55(VB)or @Tag.AnalogInt1=55 @Tag.AnalogInt1.Value=55;(C#) or @Tag.AnalogInt1=55;
Class AnalogInt
Runtime properties for AnalogInt Class.
Class AnalogDecimal
Runtime properties for Analog Decimal Class.
Class AnalogDouble
Runtime properties for AnalogDouble Class.
Class Text
Runtime properties for text class.
LockValue
Returns or changes the lock value of the text tag. Example:
@Tag.Text1.LockValue="Text to display @Tag";(C#)
Value
Returns or changes the value of the text tag. Example:
@Tag.Text1.Value ="This text"(VB)or @Tag.Text1="This text" @Tag.Text1.Value ="This text";(C#) or @Tag.Text1="This text";
Class TDataTime
Runtime properties for ClassTDataTime.
LockValue
Returns or changes the lock value of the TDataTime tag. Example:
@tag.dataTime1.LockValue = DateTime.Now;
Value
Returns or changes the value of the TDataTime tag. Example:
@tag.dataTime1.Value = DateTime.Now;
Class Counter
Sets Runtime properties for Counter Class.
Event
Provides the Tag Counter event. Possible values: "Change", "ChangeUp" and "ChangeDown". Example:
Dim counter1Event asstring(VB) counter1Event=@Tag.Counter1.Event stringcounter1Event;(C#) counter1Event= @Tag.Counter1.Event;
Model
Provides the Tag Counter template. Possible values: "Up" and "Down". Example:
Dim counter1Model asstring(VB) counter1Model=@Tag.Counter1.Model stringcounter1Model;(C#) counter1Model= @Tag.Counter1.Model;
Trigger
Returns or changes the tag counter trigger. Example:
@Tag.Counter1.Trigger | = | "Tag.Digital1" (VB) |
@Tag.Counter1.Trigger | = | "Tag.Digital1" ;(C#) |
Class Timer
Runtime properties for Timer Class.
Interval
Returns or changes the range of the Tag Timer. This is a string that represents the time interval displayed in the format "hh:mm:ss.mmm". Example:
@Tag.Timer1.Interval="0:0:10"(VB) @Tag.Timer1.Interval= "0:0:10";(C#)
Model
Provides the Tag Timer template. Possible values: "SquareWave", "Pulse" and "Comparer". Example:
Dim timerModelas string(VB) timerModel=@Tag.Timer1.Model stringtimerModel;(C#) timerModel= @Tag.Timer1.Model;
Class Reference
Runtime properties for the Reference Class.
Link
Returns or changes the Tag Reference link. Example:
@Tag.Reference1.Link=@Tag.TagName.GetName()(VB) @Tag.Reference1.Link= @Tag.TagName.GetName();(C#)
Class TDataTable
Runtime properties for TDataTable Class.
Initialize
Sets a new reference to the Table object. This method is used only internally.
Table
Provides a copy of the DataTable object. Example:
DimdtasNewTDataTable(parent,id)(VB)
Dim table As DataTable table =dt. Table
TDataTable dt=newTDataTable(parent, id);(C#) DataTabletable;
table=dt. Table;
OverwriteOnUpdate
Returns or changes the OverwriteOnUpdate operand. This property is used only internally.
Update
Updates the Table object. This method is used only internally. Parameters: DataTable table
UserType Class
Runtime properties for UserType class.
On this page:
- No labels