Siemens S-400 Reversing Bit

strebej

Member
Join Date
Sep 2002
Location
Neenah,WI
Posts
24
Does anybody know how to take a setpoint number and reverse it based on 100. In other words If I set my DB2.DBD10 to 75 (Floating Point)then have a convertor or some type of math bit convert it to 25... Or say if I put in 65 then I could get 35 out of it. If I put in 50 I would get 50 If I put in 22 I would get 78 do you understand?

Thanks

Jim
 
Hmmm .... seems easy enough, but as ever, no doubt there are hidden traps. Anyway I'll just jump right in ...

You obviously need a second register either to hold the value you enter or the result. Let's assume you want the result in DB2.DBD10. So declare a temporary variable to hold the value you enter. Let's call this, oh, I don't know, #Setpoint, OK?

And then ...


L 100.0 // Establish value of 100 in accumulator
L #Setpoint // Load your setpoint ...
-R // ... do a floating-point (Real) subtraction ...
T DB2.DBD10 // ... and store the result.



All right, what have I missed?

Ken
 
Oh, Seppo,

Why did you have to ask that?!?
It will probably turn out that this is some really weird-shaped curve with loads of hysteresis, and the section between 0 and 100 is the only linear portion!

Ken
 

Similar Topics

Hi, Yesterday, I was at a customer site. I made one little change. Changed a dummy bool output to an actual output. I didn't add any tags, or...
Replies
15
Views
329
Hi everyone, I'm working on a project where I need to exchange data between a Siemens S7-1200 PLC and an Allen-Bradley MicroLogix 1400 PLC. The...
Replies
8
Views
651
Good Afternoon. I am having a problem going online with S7-400. Attached is the error that I am getting. I have looked at the help file but the...
Replies
7
Views
1,778
I can't replace cpu S400 416-3XR05-0AB0 BY 416-3ER05-0AB0 in PCS7 Project when using replace object to keep the original configuration in the...
Replies
4
Views
1,504
I have a project where I've decided to put in a facility to change the PLC time and date through the HMI, as there's no network connection at the...
Replies
3
Views
1,900
Back
Top Bottom