Serial programming in TWIDO - Scneider PLC

Nkiritsis

Member
Join Date
Nov 2012
Location
Athens
Posts
9
Dear All,

I am a mechanical - 3D design engineer with almost no knowledge in plc programming (and limited knowledge in algorithms in general). I would really appreciate any help on my subject below as i seem to be really stack
LEt me describe what i have to do

I have an analogue 4-20mA input lets call it IN and an analogue 4-20mA output lets call it OUT
My input sensor (IN) gives results after performing a 60 second measuring cycle.

INITIALIZATION OF THE PROCESS

Turn the ''switch'' on

READ ....IN_0=0 (the 60 seconds have not passed so my initial input is 0)
Set... OUT_0=50

based on the OUT the physical process is initiated and after 60seconds i will get the initial actual input IN_1
Based on IN_1 i will perform the below calculation

OUT_1=(OUT_0 * 100)/IN_1

OUT_1 will change the physical process and after 60 secs i will get a second actual input IN_2
then
OUT_2=(OUT_1 * 100)/IN_2
simirally after 60 sec
OUT_3=(OUT_2 * 100)/IN_3
...
...
...
The process will stop when i turn the ''switch'' off

As you see every 60 seconds i get i new input and then i calculate the new output base on the previous output!!! This is where the programming is getting complicated and is wrong

Well i cannot seem to be able to work it out....most probably very easy for PLC programmers but almost imposible for myself

my PLC is Schneider TWDLCAE40DRF and the software is TWIDO

MANY THANKS
 
hello..Nkiritsis.........i think u hav only 3 inputs right.i.3 ÍN1, IN2 & IN3. U NEED PLC PROGRAMME RIGHT? HERE IS YOUR PROGRAMME...

TAKE ONE SCALING BLOCK and put values of max and min values where you want to scale exaclty...MEANS YOUR 4-20 mamp will convert into your required value let us say 0-100 now ÍN value is showing 10 mamp then our process value is 50...k take PLC-MUL block and write sources as s1=100, s2= out_0, destination= D000, and again take DIV block source as S1=D000,S2=IN_1 and destination=D002...

and write the same programme for OUT2 ,OUT3 etc..............
 
Hello niyaz432
Thank you for your reply
In fact i do not have only 3 inputs and outputs.... Let me clarify

INITIALIZATION OF THE PROCESS

Turn the ''switch'' on START TIMER ...TIMER=0

READ ....IN_0=0 (the 60 seconds have not passed so my initial input is 0)
IF IN=0
then
Set... OUT_0=50

based on the OUT the physical process is initiated and after 60seconds i will get the initial actual input IN_1
When TIMER = 60 sec i will get real reading IN_1 which will not have 0 value
Based on IN_1 I will perform the below calculation
IF IN>0
then
OUT_1=(OUT_0 * 100)/IN_1

OUT_1 will change the physical process and after 60 secs i will get a second actual input IN_2
When TIMER=2*60sec i will get IN_2
then
OUT_2=(OUT_1 * 100)/IN_2
simirally after 60 sec
OUT_3=(OUT_2 * 100)/IN_3
...
...
...
The process will stop when i turn the ''switch'' off.... until then i will have n readings IN_n and based on that i will have n outputs OUT_n
TIMER=(n*60sec)/60sec

OUT_n=(OUT_(n-1) * 100)/IN_n


IN GENERAL
IF IN=0
Then
Start TIMER
OUT=50
IF IN>0
THEN
n=TIMER/60 sec
OUT_n=(OUT_(n-1) * 100)/IN_n

As you see my problem is that i have to use OUT_(n-1) in order to calculate OUT_n...which if i get it correctly means that i have to store somewhere OUT_n-1 in order to use. How can i do this? I would guess that a LIST with 2 adresses might be usefull something like
OUT_0 OUT_1 OUT_2 OUT_3...OUT_n
OUT_0 OUT_0 OUT_1 OUT_2...OUT_(n-1)

Which means that i insert the result of the calculation on top of list and push the others lower. Then in use the top element to calculate the next out and when i have the result is put it on top of the list
I have allready scalled my inputs and outputs and they are able to get all the range of readings from my sensor (input) and to drive my output

THANKS
 
Not sure if I undestanded it right, but you have one input and one output?

Or several inputs and one output?

But maybe something like this. You need save your output value of previous calculation to word, and after that you can update your output with new value
 
LARE thank you very much for your reply....

I do have only one input(from a sensor) and one output(to a power supply) but both change every 60seconds. Every 60 seconds i get new input and based on the new input and the previous output i calculate the next output. So both change every 60 seconds.

I did check your programming and merge it in my process.....

IT WORKS!!!! IT REALLY WORKS!!!!!

I AM SO GREATFULL!!!

THANK YOU VERY MUCH....I WAS PUZZLING ON THIS AT LEAST 10 DAYS

IF YOU NEED ANY KIND OF DESIGN (3D or 2D) DO NOT HESITATE TO CONTACT ME... I WILL BE MORE THAN HAPPY TO HELP

THANKS
 
Ok. You maybe want take a look to so called fifo function if you want delay output more. Just little bit curious, what kind process need this. Heating something maybe?

Glad that it helped and welcome to forum.
 
Last edited:

Similar Topics

Hello guys, I am new to WAGO PLCs and e!****pit. I am trying declare variables from a Modbus Slave Connected using serial to WAGO PFC200 and pass...
Replies
0
Views
1,325
Do the Horner adapter RS 232 to snp adapter could work on that plc to go online with my laptop and Proficy ? HE693SNP232A with a IC200CBL001A I...
Replies
4
Views
1,933
Dear all, I have these 2 problems. 1. siemens s7 200 programming cable 6ES7 901-3CB30-0XA0 (both ends serial ports). My laptop does not have a...
Replies
2
Views
3,741
does anybody know the diagram of the REDLION KADET PROGRAMMING SERIAL CABLE diagram? we are using it first time. previously we are sing...
Replies
6
Views
2,899
Hello I need to connect to a GE versamax Micro IC200UDD120 through RS-232 serial port 1 (RJ45) to program it. Does anyone knows the cable pinout...
Replies
2
Views
7,010
Back
Top Bottom