Long Registers in Siemens S7 300

Ozzie01

Member
Join Date
Aug 2014
Location
wa
Posts
24
Hi Guys,

I have got a bit of a situation which I need some help in.


Firstly I have Modbus connection to my 314C CPU.

Most of the data is coming in correctly except for a value on engine runtime.

The Engines manual has the following.

Engine Runtime =
40044 Low Register
40045 = High Register


For the Data Points Engine Runtime, for the two registers designated as high and low are put together as an unsigned double integer.
This is accomplished by multiplying the value in the high register by 65536 and adding it to the value in the low register. Most software packages automatically perform this calculation if the value is simply identified as an unsigned double integer.

My question is how do go about combining the both of the registers so they can be displayed on a screen in a single box.

Also these values are in seconds and must be scaled down by a factor of 10 and converted to hours.

This should not be too much of an issue if I can get the two registers together as an Double Unsigned INT

Any ideas??


Any help is greatly appreciated
 
Hi Kalle,

Thank you for your quick reply.

I have tried your solution and it nearly works.

I am using Modsim to simulate the value into the CPU unit.

Now when I enter a value of (17 x 3600 x 10) = 612000 i get back some strange numbers. And it also spills into the next register 40046

But when I input a value of 61200 i get returned a value of 17 Hours which is correct.

It appears that the value is out by one 0


Can I ask what are the SLD & OD functions??
 
SLD = Shift Left Double. It takes the value in Accumulator 1 ans shifts the bit pattern to the left by the specified number of bits.

ACCU 1 = 0000 0000 0000 0000 0000 0000 0000 0001
SLD 16
ACCU 1 = 0000 0000 0000 0001 0000 0000 0000 0000

OD is a logical "OR" of accumulator 1 and accumulator 2

ACCU 1 = 0000 0000 0000 0001 0000 0000 0000 0001
ACCU 2 = 0000 0000 0000 0011 0000 0000 0000 0000
OD
ACCU 1 = 0000 0000 0000 0011 0000 0000 0000 0001

In the editor, if you highlight an instruction and press F1 you will be shown the help for the instruction.

Hope this helps your understanding,

Nick
 

Similar Topics

Any ideas using"Shift Registers"for Vision Failures on long conveyors for Dump Gate? Good Morning , We are starting a quality program...
Replies
15
Views
3,828
I have Allen Bradley plcs, I have had Circuit breakers and other automation equipment in the past. There's no solid buyers local. How much do you...
Replies
2
Views
202
I have a question. I work in a very large plant and this one (of many hundreds of control cabinets) contains one 5580 (1756-L83E), two 1756-L73...
Replies
6
Views
203
Hi to everybody. I need to read the first 12 characters of the message that a barcode reader sends to the ascii card (1734-rs232 ascii) and I...
Replies
8
Views
725
Hello all. This is a very lonnnnnnng shot but worth a try. I have an OMS Group Impact100 metering machine. At this customer it blows foam into 3d...
Replies
0
Views
185
Back
Top Bottom