Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fastrack Software Help 1

Status
Not open for further replies.

controltestguy

Electrical
Mar 10, 2004
19
0
0
US
Is there anyone out there that could help me program STL or a function block so I can get a SIMATIC S5 115U 943 processor to output a value to the real world via a 470-LA12 analog output module?

I've been struggling with this for a while but hit a brick wall.

I really need someone to walk me through it once and I'd be alright.

thanks,

CTG
 
Replies continue below

Recommended for you

OK there are two ways of doing this. the first is simpler to understand and the second is more complex but you may find ultimately that it reduces the amount of math’s in you main program.

1) Siemens analogue cards must be addressed as a peripheral address. so set the address of the 470 card, it should be somewhere between 128 and 224, on a 115U rack this is done on the IM306 card at the end of the rack.
the simplest way to write to the card would be :-
L FW 100 = This loads the data from Flag Word 100 into the accumulator
T PW 128 = This transfers the data from the accumulator to the card addressed at peripheral word 128

If the card is addressed at 128 then the channels will be
channel 1 = 128
channel 2 = 130
channel 3 = 132
channel 4 = 134
...ect

Of the two bytes used the data used to make up the value of the output is the most significant 12 bits of the 16bits.

This method is clean and easy to understand, but means that you have to do the math’s to convert the data in your program to a relevant value for the card to output. This is the method I use to test a 470 card.

2) there is a function block that can be used to write to an analogue card FB251 this is explained in chapter 10 of the 115U manual page 10-58. This allows you to create the upper and lower limits of the range of the card then tell the function block what the card is to output and it will calculate the correct output value for the card. i.e. if you say the upper limit is 100 and the lower limit is 0 for a +10v output channel, then tell it that the value is 50 the function block will calculate the correct value to output to the card in order that it outputs +5v.
the STL for this call would be
JU FB 251 = jump unconditionally to function block 251
NAME: RLG:AA
XE : FW 100 = Analogue value to be output is read from flag word 100
BG : KF +128 = address for the 470 card
KNKT : KY 0,0 = KN is the channel number on the card KY determines wither the card is unipolar or bipolar
ORG : KF +100 = the upper limit of the range is 100
URG : KF +0 = this is the lower limit of the range
FEH : F10.0 = if you ask the function block to write to a channel that isn’t there this flag will be set
BU : F10.1 = if you ask the function block to write a value that is out side your range (ORG to URG) than this flag will be set.



I hope this is of some help to you, I know this stuff backwards but its so hard to put it in writing! Let me know if you need more help. Good luck and if your new to SIEMENS then don’t let them get you down its them that are unnecessarily complex not you that can't understand.

Nick

 
tesection-

Thanks very much for your help. It's becoming much clearer now. If I could impose on you one more time:

To start STL, do you first have to have a rung in the program validated first? And how do you program the JU to Blk 251. If I can get past this, I've got it.

thanks again.

CTG

 
CTG,

All STL progrms start in Object Block 1 OB1 so start your code here. you cant use all comands in an OB so it is common for your first line to be an unconditional jump to a program block say PB1 the PLC cycles though the program and starts again at OB1 when its finished. At the end of a block you must have a Block End Command BE.
So if you want to write a short program to write to you analogue card it could be:-

OB1

JU PB1
BE


PB1

JU FB251
NAME:RLG:AA

XE : FW 100
BG : KF +128
KNKT : KY 0,0
ORG : KF +100
URG : KF +0
FEH : F10.0
BU : F10.1
:
: BE

This would continually write the content of Flag Word 100 to the analogue card at address PW128.

and thats about it, enter the code to the processor and pop it into run, use the force variables function of the programmer to write to FW100 and the outputs of the card should change acordingly.

I hope thats of help to you I dont think you need to validate the program.

Nick.

 
Hi Nick-

We've made some progress but we're hung up on the KNKT function. When entering KY 0,0 the software comes back with "Constant out of Range". If I drop the KY and enter 0,0 the software comes back with "Segment One: Invalid Address".

I'm not sure what data the KNKT block is looking for. The book says the format x,y is the 'channel number and whether it's bipolar, unipolar, etc.

Can you help?

thanks,

CTG
 
CTG,

The KNKT entry field is for two byte length inputs, as you describe, the first KN is the channel number and the second defines wither the channel is by-polar or unipolar.

The KN entry should be 0 to 7 for a 470 card, as there is only 8 channels.

After entering a valid card start address under the BG field e.g. 128 the programmer should write the prompt for you to enter the KNKT variables.

I cannot make my PG750 programmer give me the same errors as you have.

Question, when you are entering code into a Program Block if you write

JU FB251

Will the programmer automatically follow this line with the line

NAME : RLG : AA

?

If the answer is yes this is good. If not then the programmer has not included the FB251 into your program. This is a problem I have just had with my programmer. For me the easiest answer is to start with a programmer that already uses this function block, then rename it and adapt it to suit my needs.

If you have an email address I could send you a copy of a program I wrote that tests analogue cards using FB251?

Nick
 
tesection

We've made some progress thanks to your help. We're using the load and flag word example to write to the module.

I would be interested in seeing the FB251 example. Could you send the example to bas_00@yahoo.com

Thanks for all your help and to the others that responded. Your service is appreciated greatly.

thanks,

CTG
 
Status
Not open for further replies.
Back
Top