S7-1500 SCL, TIA V14 versus Classic

Pete.S.

Member
Join Date
Mar 2016
Location
Fl
Posts
463
Hi guys!

Is there a document somewhere that states the difference between SCL in TIA portal versus SCL in classic Step7?

I want to reuse some code from old projects into the TIA portal but I get many hundreds of compile errors.

For instance this one:

Code:
   function XYZ : void
   var_temp      
      z             : word;
      bit [B]at[/B] z : array [0..15] of bool;
   end_var
Generates the error "Data type AT construct is not allowed here."

But looking at the help file using "AT" is perfectly fine but not in the same places as before it seems.


Also
Code:
   function XYZ : void
   [B]const  [/B]
      b0 := 8;
      b1 := 9;
      b2 := 10;
   end_const
Generates the error "Unknown instruction" on const.
Isn't local constants allowed anymore inside functions?


Anyway, I searched the net for some kind of new versus old on SCL but came up with nothing. Any suggestions?

Thanks!
-Pete

PS. I'm using the function where you generate blocks from external source files.
 
How about this
I did it in the TIA editor, and it compiles ok.

FUNCTION "Block_1" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_TEMP
z : Word;
"AT ATz" : Array[0..15] of Bool;
END_VAR

VAR CONSTANT
b0 : Int := 8;
b1 : Int := 9;
b2 : Int := 10;
END_VAR


BEGIN
END_FUNCTION
 
How about this
I did it in the TIA editor, and it compiles ok.

FUNCTION "Block_1" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_TEMP
z : Word;
"AT ATz" : Array[0..15] of Bool;
END_VAR

VAR CONSTANT
b0 : Int := 8;
b1 : Int := 9;
b2 : Int := 10;
END_VAR


BEGIN
END_FUNCTION

That's great Mike!

VAR CONSTANT looks like it's the replacement for const.

But the AT command hasn't the same function anymore. You just used it as a name.

The purpose of the AT is to overlay two different variables on top of each other. In my case I wanted to access bits in a word like an array or the word itself. Maybe there are other ways to do the same thing. By overlaying with AT, two types of variables occupy the same space. Most structured languages has support for this in one way or the other.
 
Last edited:
Hi guys!

Is there a document somewhere that states the difference between SCL in TIA portal versus SCL in classic Step7?

I want to reuse some code from old projects into the TIA portal but I get many hundreds of compile errors.

For instance this one:

Code:
   function XYZ : void
   var_temp      
      z             : word;
      bit [B]at[/B] z : array [0..15] of bool;
   end_var
Generates the error "Data type AT construct is not allowed here."

But looking at the help file using "AT" is perfectly fine but not in the same places as before it seems.


Also
Code:
   function XYZ : void
   [B]const  [/B]
      b0 := 8;
      b1 := 9;
      b2 := 10;
   end_const
Generates the error "Unknown instruction" on const.
Isn't local constants allowed anymore inside functions?


Anyway, I searched the net for some kind of new versus old on SCL but came up with nothing. Any suggestions?

Thanks!
-Pete

PS. I'm using the function where you generate blocks from external source files.

Here are some links that may be of some help:

Must read and includes links to the documents below
Document1
Dcoument2
Document3
Document4
 
Hi guys!

Is there a document somewhere that states the difference between SCL in TIA portal versus SCL in classic Step7?

I want to reuse some code from old projects into the TIA portal but I get many hundreds of compile errors.

For instance this one:

Code:
   function XYZ : void
   var_temp      
      z             : word;
      bit [B]at[/B] z : array [0..15] of bool;
   end_var
Generates the error "Data type AT construct is not allowed here."

But looking at the help file using "AT" is perfectly fine but not in the same places as before it seems.


Also
Code:
   function XYZ : void
   [B]const  [/B]
      b0 := 8;
      b1 := 9;
      b2 := 10;
   end_const
Generates the error "Unknown instruction" on const.
Isn't local constants allowed anymore inside functions?


Anyway, I searched the net for some kind of new versus old on SCL but came up with nothing. Any suggestions?

Thanks!
-Pete

PS. I'm using the function where you generate blocks from external source files.

Use the migration tool instead.
 

Similar Topics

Hi guys. I have a challenge that I'm struggling with and I can't help thinking there's a really easy solution. I want to move a series of...
Replies
18
Views
5,752
Hi all Trying to remotely connect to a TIA Portal PLC. I can ping it without a problem but can't get my software to connect. I've opened port...
Replies
8
Views
283
Been fighting all morning with a stubborn HMI. It just won´t connect with the plc. attaching from settings. Have i missed anything? Both plc and...
Replies
5
Views
240
Hi there, Maybe I am overthinking this issue, but here is what I have going on. I have a program running for a water valve on a DI system. We...
Replies
4
Views
429
Hello, I am programming in S7-1500, V17. I have some blocks from a drive manufacturer that are not compiling and giving me an error "Invalid...
Replies
2
Views
273
Back
Top Bottom