07-06-2011 05:28 AM
Hello,
i want to use the Property Loader to change a TS variable.
I have a variable StationGlobals.Status. In this variable is the last failure status like "Test1".
Now i want to load a description of this failure from a .txt file like
"Test 1
- check connections
- check ...." and put it in the same variable.
And this for more Tests like "Test2", "Test3" ....
Can i use the Property Loader for this?
The .txt file should look like this:
Test1
Test 1
- check connections
- check ....
Test2
Test 2
....
.....
I use TS2010.
Hope somebody can help me.
regards
Schwede
Solved! Go to Solution.
07-06-2011 06:10 AM
Schwede,
i am confident that, depending on the purpose of that text (dialog, report, ...), there are other, maybe more flexible ways to solve this.
Nevertheless, you can do this using Data Markers in the property file.
hope this helps,
Norbert
07-06-2011 06:20 AM
What is the better way...?
It should be from a text file because the user should edit it.
The status will be displayed in the error banner.
07-06-2011 06:35 AM
A possible (imho 'better' way) would be a custom dialog module, loading the error message from an external *.ini or *error.txt file.
This will make the request obsolete and does not meddle with data stored in TS (execution).
just my 5 cents,
Norbert
07-06-2011 07:55 AM
Hi,
Not all Step properties can be changed by use of the PropertyLoader, I not sure about the Status property.
07-06-2011 08:01 AM
I think my configuration is wrong. It don`t work.
07-06-2011 09:49 AM
Can you post an example.
07-07-2011 01:08 AM
This are my settings:
see attachment
The step is in the PostUUT Sequence of the parallel model.
The .txt is like this:
// --------------------------------------------------
// Properties for "Pulsbreite"
// --------------------------------------------------
>
<StationGlobals> Variable Value
Testplatz_1.Status "Test Description"
<
The ">" is only for testing. It should be later the StationGlobals.Testplatz_1.Status variable.
Take the string of this variable and if it in the .txt file replace it with the string in the file.
I don't use the Property Loader before.
07-07-2011 02:51 AM
Its not wise to use < and > as the Start and Stop markers as these are used to indentify the different elements such as Step Name,
FileGlobals, StationGlobals.
Check out the Manual Appendix D
usual format is:
Start Marker
...
<StationGlobals> Variable Name
Testplatz_1.Status "Test Description"
End Marker
07-07-2011 03:44 AM
Attached you can find a small case study for your request. I hope this answers your question (nevertheless, i think another solution would be "easier" to maintain).
Please note that Ray's comment above exactly refers to one issue i had with my implementation first (found the markers, but did not import anything!). You have to have all parts of the variables in the marker-section as seen in my limit file. Refer to this link where i found the hint for this insight.
hope this helps,
Norbert