s7 scl adding 2 butes

ssantiago

Member
Join Date
Mar 2010
Location
Minsk
Posts
28
Hi, can anyone explain me why s7 scl compiler doesn't allows me to add two bytes. I wrote this simple code and got error "E: L 00028 C 00024: Invalid types of addresses" in each row with adding bytes:
Code:
VAR_TEMP
    b1:BYTE;
    b2:BYTE;
    b3:BYTE;
    b4:BYTE;
END_VAR
    b1:=b#16#0 + b#16#1;
    b2:=b1 + b#16#1;
    b3:=b1 + b2;
    b4:=b1 + 1;
 
Addition can only be performed on integeres, double integers and reals. You have to convert the bytes to ints to perform addition.
 

Similar Topics

HI i would like to know how to get a variable that will store the amount of times a program has been executed. The issue is I have 3 DBs for 1 FB...
Replies
2
Views
99
Hi, I have an intermediate-advance knowledge of programming with TIA Porta in Ladder, would you recommend me to start learning SCL for it to...
Replies
11
Views
579
Hello nice to meet you, im new in here, I'm currently trying to convert code written in STL for a S7-400 to SCL for an S7-1500, because when i run...
Replies
5
Views
351
Hi everyone, I am new to this amazing world of PLC, well... I mean, in practice, since I already knew electronics, programming languages, IT, and...
Replies
7
Views
664
Hi all, This is my first post; I am new to PLC Controls stuff and English is not my native language, so I apologize in advance if something is...
Replies
4
Views
518
Back
Top Bottom