I'm currently trying to convert code written in STL for a S7-300 to SCL for an S7-1200. I'm getting stuck trying to address inputs in SCL and assign the offset like I have done in STL. I would be grateful if ye can point me in the right direction on how to convert this code to SCL. Do I need to declare variables to access the inputs and outputs?
My current DB has an array of [1..18 1..8] of integer and then 40 bools. These relates to 18 switches with each switch having 8 physical switches and 40 different lights that can be switched on. The integer value in the array (0 - 39) corresponds to the actual light that I want to switch on. I'm totally new to SCL so any further help is greatly appreciated.
I think that if you have 1200 CPU with FW4.1 or later then you can use serialize and deserialize commands for copying array of [1..18 1..8] of integer to new array 1...144 of integer.
Then loop these 1..144 integer value as you have done STL and SET bool outputs according of values.
With your help I finally managed to replicate my STL function in SCL. I needed to and a third array of 144 bools for the physical switch. I must admit my description of what I required was not the best. Attached is my final code, commented which hopefully explains what i was trying to achieve.