Siemens Scl - String Debugging

aracioppi

Member
Join Date
Mar 2004
Posts
35
I´m programming in SCL using the PLCsim simulator
When I debug for instance integer variables, I can see their value in the right window.
But, when I´m working with strings, I can´t see their values

Any ideas??
Thanks in advance
 
The online monitoring function can not display strings. Create a VAT and look at 4 bytes at a time in "CHAR" format.
 
SCL - Strings

RRobins:
Thanks for your answer.
But how do I know the address of a string variable so to put it in a VAT??
I mean, how do I reference the string?

Thanks again
 
Hello;
When you need to access a variable that is larger than 4 bytes in a Siemens PLC (such as a DT, or a string), use symbolic addressing. Place the symbolic name (from the Symbols editor) as the address in the VAT table, and you will be able to monitor the value.

Hope this helps,
Daniel Chartier
 
SCL - STRING

Dchartier:
Thanks
I understand what you say, but I don´t see how to insert a string variable in the symbols editor. Should I insert the first character acting as a pointer??
I´ll pu an example to see if you can help me.
I have a variable in SCL strFrameIn: string[10] included in DB1 of FB1.
I can see each character watching DB1.DBB1, DB1.DBB2, ETC
Is there another easier way??

Thanks again
 
Hello;
First, in the Symbols editor, give a symbolic name to DB1 (let's say "Test_DB"). Then open DB1 and look at the name of the string you have created: it should look something like this

Address Name Type Initial Val Comment
24.0 My_String String[10] 'Test Strg' My first test


In the VAT table, access this string variable symbolically as: "Test_DB".My_String


Hope this helps,
Daniel Chartier
 
SCL - String

Daniel:
Thanks again
The problem is that when I put "DB1".STTRAMAGPSIN with or without the "", the name turns into red and the tooltip says The Address is not correct

Any idea??
 
Try just using DB1.dbd0, the next line DB1.dbd4, etc. You will display in CHAR and see 4 chracters on each line
 
ok, I see 4 characters by line
Do you know if it´s possible to define a UDT bigger than a double, so to se more than four characters??

Thanks again
 
Hello aracioppi;

Did you give your DB1 a symbolic name "DB1"? Bad practice if you did.
For a new symbolic name: Open the Symbol editor in Step7, choose a free line -at the bottom of the editor; write the name you want for DB1, then write DB1 in the next 2 colums. save and exit. In your program editor, you will have access to all DB1 variables through their names: "DB1_symbolic_name".variable_name.

Hope this helps,
Daniel chartier
 

Similar Topics

Hi I am playing around with SCL & Strings, what is the problem with the string assignment VAR_TEMP MyString : STRING[20] ; END_VAR MyString...
Replies
5
Views
3,004
Hello, When you want compare values of an array to a range of numbers is it a right way to do that? FUNCTION ADD VAR_IN_OUT A:ARRAY[1..50]...
Replies
5
Views
2,045
Hi All, I need to try and convert some code from Siemens SCL (TIA16) over to Allen Bradley RS5000. I have attached an image of the SCL and what...
Replies
10
Views
4,025
in the scl code written in screenshot Line 1 condition is false but still the program checking the line 2 condition and says it is true i had...
Replies
3
Views
1,736
I am new to PLC programming. Is there a standard way to incorporate alarms / warnings / events such as the exceptions in C++ or Java where you can...
Replies
5
Views
1,934
Back
Top Bottom