Sign in to follow this  
Followers 0
mr_shadow

SCL LANGUAGE PROGRAMMING

2 posts in this topic

Hi everybody; As i wrote to the forum before i have some problems with the fb usage the main problem is: The function blocks has a restriction for the number of input and output there can be maximum 64 inputs and 64 outputs. I am making a production line program per each machine there are prof?bus remote i/o devices and in the line there are some machines which has same algorithms so the thing i want to do is: making a function block related with the algorithm of this machine type and in the main program there will be these function blocks named with the machine number for example machine_1, machine_2, e.t.c, as i wrote above the algorithm of machine_1 and machine_2 is same only the physical inputs and outputs will change and machines will work independently. Normally i create a function block named machine_x and i define the inputs and outputs as "bool" in the function block. And in the main program i put the inputs and outputs with the physical machine_1's and machine_2's digital i/o's like 3200.0, 3200.1 ,3300.0, 3300.1. But in this case if machine has more than 64 digital inputs or more than 64 digital outputs you couldn't create a function block with this type of machine. My questions are: 1. In the cases like this i can make the inputs and outpus word and in the fb i can use "mov" and "compare" commands, but in this case the fb takes more place in the program memory and data memory ,and there will be some some difficulties with naming the symbols of the fb, for example you have a program network which will make an output to a drain_valve by pressing the start button but you couldn't write the fb with "LD" AND "OUT" "instuction. What are your opinions for handling to this problem? 2. My opinion is creating a simple function block with SCL high level language which can convert the word inputs to the internal boolean array and can outputs these arrays as boolean. In the start of the program if i call this fb 10 times with different input words then fb will convert this words to my internal input boolean bits ( start button,e.t.c) i will use these bits in the program. As there are not restrictions for the internal variables i can read 64X16 digital bits and if i make the inverse of this trip at the and i can write 64x16 digital outputs with using function blocks. But i don't know the SCL commands can anyone send me some documents which describes the SCL commands (with examples it will be perfect")

Share this post


Link to post
Share on other sites
Mr_Shadow, SCL language is ST (Structured Text) ? If so please find ... Attached examples of extracting bits from input words within FB using both ST and Ladder. Yes this could be used to increase the number of potential FB boolean inputs/outputs beyond 64. Using these as nested FB's would probably be the way to go. I have not provided the reverse example - 16 bits to 1 word output - but this is quite easy also. Nibroc WordToBit.cxp Edited by Nibroc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0