Siemens Step5 150u Analogue Output Scaling

b16mcc

Member
Join Date
Jul 2006
Location
North West
Posts
20
Hi guys. I'm looking for a simple method of scaling an analogue output on a Siemens 150u.

On the 115u in comparison, I would simply use FB251, but as this is not available in the 150u I am somewhat stuck.

I simply want to provide a value from a data word and scale it to an analogue output.
Any help would be greatly appreciated, thanks.
 
The block is called RLG:AA it's part of the operating system of the 115u and available for the 135 and 155u in a file called S5AA20ST.S5D or S5AA60ST.S5D respectively.

As Siemens no longer acknowledge the existence of the 150u , its not listed on the page. This leaves me wondering , did it ever exist or not ?
I've logged a call with Siemens Tech Support and they usually ring back pretty quick.
Has anyone come across this FB for the 150u , or can anyone shed any light on how I might do it.
Thanks.
 
Just create your own FB, all you need is parameters passed to it like value in (scaled to whatever i.e. 0-150.0) then offset for 4-ma (if used) span for 20ma (if used) then zero & span variables to scale up the analog raw value and the PW No.
the raw data is formatted as below

bit 0 to 3 not used in A/O
Bits 4 to 14 are the analog value 0-1024
Bit 15 is the sign bit
so once you convert your signal e.g 0-1500 (0-150.0) to 0-1024 you then shift it right 4 places.
(if 2 compliment +- 1024 then you need to set the sign bit as required)
This only applies to U range analog cards like 470 7LB11
The K range only has 0-255 i.e bits 0 to 7 & 8 is the sign bit.
The Analog inputs use a similar process however the least significant bits 0-2 are error/status bits so to convert the raw you shift left 3 places (store lower bits for status/errors) the raw value is +-2047.
Bit 0 is Overflow bit Bit 1 is Fault (open circuit) Bit 2 is Busy
 
Last edited:
Thanks for the reply parky. I'm in the process of building a rig to develop this on. I can't afford to crash the actual machine whilst I'm putting this together.

I kind of understand your description, but I'm not sure I can implement it. I'm gonna get a rig running then start throwing some STL together. Now I know the bit pattern of the word I need I can at least make a start.
Thanks again.
 
Update:- I've managed to realise the basics of the code required is actually very very simple. The 3 lines of code achieved exactly what I was looking for. Knowing the required bit pattern makes the job a whole lot easier.

I'm happy to use a reference value of 0-1024 and so there's no scaling as such required. I simply write a value of 0-1024 to my Flag word and then shift it, before sending it out.

L FW200 (Load my reference value 0-1024)
SLW 4 (Shift left word 4 to match the required bit pattern)
T PW160 (Transfer modified word to my analogue output)

It works perfectly as proven on my 155u test rig.
 
Glad to help, it's been 11 years since I last used S5 but somewhere I have blocks that contains all the functions you would require for both AI & AO but I do not have S5 anymore so unable to post the code.
If I find it & manage to find my old S5 disks I will post it.
 
Sounds good mate. I can fix you up with S5 if you really want it.
I've just put this code into my 150u when production finished today. So far, its NOT working. Not sure why yet, not sure if its something else in the code, a bad card perhaps. I don't know yet. After getting it to work very easily last night on a 155u test rig I'm somewhat disappointed at it not working on the 150u.
Gonna sleep on it.
 
Is the card an existing card? if not & the card was not recognised then you should get an error QVZ I think (I/O)
Is the card the same as the card used in the 155 We never used the 150/155 type racks only the main rack then 115 I/O racks for digital & Analog cards with IM??? interface
Also not knowing the configuration of your system have you got the right PW etc.
 
Could it be that the AO is written to somewhere else in your program?

I don't remember exactly, but think the AO block was adressed by the start addres of the card (KF) and the channel/type (KNKT(KY)). If I am right, it is impossible to search for the start adress in S5. But you could print all blocks to a text file and search the file for the start adress number.

Btw, you could probably check this by putting your new code at the very end of OB1. If it works now, but not if you put it at the start of OB1, it is written to in the program before. If it is unstable, it could be written to from an interrupt OB.

Kalle

Edit: @ b16mcc. I just had a flashback - RLG:AA was FB41, wasn't it?
 
Last edited:

Btw, you could probably check this by putting your new code at the very end of OB1. If it works now, but not if you put it at the start of OB1, it is written to in the program before.

Normally I am far from quick, but this was still too quick and is not correct.:oops:

Writing to the AO (T PWx) addresses the output card directly and therefore this suggestion will not work reliably.


Kalle
 
Transferring to the PW directly should not be a problem in 150/155 Then again we only used 115 I/O racks for I/O with the interface cards, only comms/WF470 etc. were used in the main rack the only other thing I remember about the main rack was that only so many special function cards could be used without solder link changes on the backplane what is your I/O layout, are the I/O cards in the main rack etc.
 
Right chaps, thanks for your input, it makes an interesting read. I'll try and clear up a few things for you.

I'm using 150u with 115u I/O racks. There is no I/O in the main rack.
The card I'm using is an existing card but all Outputs are spare.
I've tried addressing to a single spare output on another card where some other outputs are used, but I get the same non responsive output.
It did cross my mind that the outputs could be referenced elsewhere in the program but I've been unable to prove this so far.
The outputs are referenced as OW , not PW. I've never seen this before. When writing the STL , S5 will not allow me to enter T PW or T QW.
The card I'm trying to use is a 6ES5 470-7LC11
It is the same card I used in the 155u test rig. (It worked ok in the 155u)

Kalle, yes it was FB41, I can't find it for the 150u.
 

Similar Topics

Hello Everyone! I just became a member of this great site. I have a PLC program from an S5-100U PLC, and now I want to make a PDF report of all...
Replies
3
Views
1,563
Hi Guys, Could anyone please help me understand how this instruction in step5 works: ----(#)---- it has the address F1.5 in particular for the...
Replies
3
Views
1,714
Hello Forum members, I'm curious... has anyone tried to run Siemens Step5 V7.23 on Windows7 yet? I'm getting a new laptop and it will come with...
Replies
5
Views
13,090
Dear PLC Experts, I am trying restore program in Siemens S5 115U CPU 945.I have backup of program unable to open with STEP 5 V7.23. I tried with...
Replies
8
Views
11,541
I have a New Siemens PG with a MPI/DP 9 pin port on the back of the PG itself. I am trying to connect to a Siemens Simatic 505 with a 525 CPU 9...
Replies
8
Views
9,522
Back
Top Bottom