IORRWriteState() function
- Last UpdatedJun 17, 2024
- 4 minute read
The IORRWriteState() function saves information about the current state of an application’s remote tags to a text file. The function creates the file if it does not exist. Each time the script containing the function runs, new information is concatenated to the file.
You can specify what remote tag information is saved to the file. Also, the function’s return value indicates whether information is added successfully to the file.
Category
Miscellaneous
Syntax
IORRWriteState(FilePath, Option, " ");
Arguments
FilePath
Full folder path to the text file containing information about an application’s remote tags. The FilePath argument can be a string constant or a message tag.
Option
An integer tag or integer constant that specifies the remote tag count information written to the file. Possible values are:
|
1 |
List of current remote tag addresses. The information also includes each remote tag’s state, activation time, and deactivation time. |
|
2 |
List of all currently active addresses, including activation time. |
|
3 |
List of all remote reference tag addresses that have been activated and counted against the license limit. New items are added to the list as new remote tag addresses are activated. When the license limit is reached, no further items are added to the list. However, no addresses are added to this list if the remote tag license limit is unlimited. |
|
4 |
List of current addresses not activated because the remote reference tag count exceeds the license limit or because the internal tag handle limit was reached. Does not return addresses related to licensing if the remote tag license limit is unlimited. If the licensing is unlimited, the list contains any items that are not currently active because of implementation limitations. If any item in this list becomes active, it is removed from the list. When an item is deactivated because of licensing limitations, it is removed from the list. This list updates while the InTouch application is running. |
Empty String " "
This argument is reserved for future use, but must be included with the IORRWriteState() function in a script.
Results
These are some examples to interpret information saved to the file by the IORRWriteState() function call.
Current Addresses Listing
The following line from the output file shows an example of a fully activated remote reference tag, which can be updated. This line shows that address 65535 is assigned to the TestProt:di000 remote reference tag:
65535 <TestProt:di000> (RAA) {C:5/23/2007 9:58:35 AM} {A:5/23/2007 9:58:35 AM}
Following the remote reference tag name are three flags enclosed within parentheses:
-
The first flag, R, indicates the tag’s remote reference has been successfully resolved. The first flag is assigned a value of X if the tag’s remote reference is still pending.
-
The second flag indicates if the remote tag is currently active, A, or inactive, D.
-
The third flag indicates if the address is allowed, A, or disallowed, D, because of licensing restrictions.
The date following C indicates when the remote tag was created. The date following A shows when the tag was most recently activated. The line includes a trailing deactivation time if the remote reference tag has been deactivated while the InTouch application is running.
The following line from the output file shows an example of an active remote reference tag that exceeds the tag count limit of the InTouch license. The tag’s remote reference is successfully resolved and the tag is currently active:
65414 <TestProt:di121> (RAD) {C:5/23/2007 9:58:35 AM} {A:5/23/2007 9:58:35 AM}
But, no tag value updates occur within the InTouch application because the address assigned to the remote reference tag exceeds the tag count limit of the InTouch license.
Active Address Listing
The following line from the output file shows an example of a fully activated remote tag whose assigned values update the InTouch application:
65429 <TestProt:di106> (A) {C:5/23/2007 9:58:35 AM} {A:5/23/2007 9:58:35 AM}
The first number is the remote tag handle, followed by the address, then the flags, A, for allowed or D for disallowed. The creation, most recently activated, and most recently deactivated times follow the flags in the output line. The deactivation time does not appear if the remote tag has never been deactivated while the application is running.
The following line from the output file shows an example of an active remote tag that exceeds the license limits:
65342 <TestProt:di193> (D) {C:5/23/2007 9:58:35 AM} {A:5/23/2007 9:58:35 AM}
Licensed Addresses
The following line from the list shows the address assigned to the remote reference tag and when it was added to the list.
<testprot:di000> {C:5/23/2007 9:58:36 AM}
Denied Addresses
Denied addresses appear in the list because of implementation limitations, or because the tag count exceeds license maximum.
This example shows a remote tag address, which exceeds the license limit:
testprot:di125 [1] (L) {F:5/23/2007 9:58:39 AM} {R:5/23/2007 9:58:39 AM}
The address is listed along with the count to indicate how many times an attempt was made to reference the item. The flag indicates if the address is in the list because of an exceeded license, L, or because of an internal implementation limit, I. The two times represent the first time it was added to the list and its most recent access time.
Example
This example writes the current activated remote tag addresses to a file located in the c:\intouch\data folder. The ReturnValue tag is assigned an integer, which indicates whether the function call successfully wrote remote tag information to the file.
ReturnValue = IORRWriteState("c:\intouch\data", 2, "");