Siemens 928 Int to float

MWhite

Member
Join Date
Sep 2007
Location
Kempston
Posts
3
Hi,

The following code had been running for 10+ years on a 928A ....

L DW1
L DW2
-F [HIGHLIGHT]DW1 - DW2 as a 16-bit integer[/HIGHLIGHT]
FDG [HIGHLIGHT]Convert to floating point.[/HIGHLIGHT]

Note that this used to work ok even when the result was negative.

The CPU was replaced with a 928B and the above code no longer worked. The result of the -F was correctly calculated, with sign, but the sign was lost during the FDG. It appears that FDG converts a 32-bit number to a floating point, and if the sign from the -F was bit 15, this becomes just a part of the number in a 32 bit int. It is not treated as the sign bit, and hence the conversion to float doesn't work correctly.

A call to OB220 (Sign Extend) fixed the problem. However, I cannot fathom how the code ran ok on the 928A. There is a document on the Siemens site about pre-1997 928Bs having a problem with 1-L and 1-H when doing -F, +F, *F but nothing to explain how this might work with a 928. I don't have the firmware versions of either the original or the replacement CPU.

Can anyone cast any light on this please?

Thanks,

M
 
Last edited:
Hi,


Thanks for the link. I'd already read that, but it still seems to require an unlikely set of circumstances to explain the problem.

As I read the notice, it gives no details about how a 928A would respond in the same circumstances. If we assume that the A behaves in the same way as the B, and the same fix was applied in 1997, this does not explain how a machine built in 1995 ever worked with the code that was apparently used.

The only information I currently have would appear to require that the machine was running with a post-97 928A, and replaced with a pre-97 928B.

I'm confused about the lineage of the 928. Was there even a 928A? Or was the predecessor to the 928B "just" a 928?

The original CPU was 6ES5928-3UA12 and the replacement was a 6ES5928-3UB12. I notice that the linked document refers to 6ES5 928-3UA21 and 6ES5 928-3UB21. What's the difference?
 
Hello old friends,

As I read the technical note, the information about the behavoir of pre and post 1997 CPUs is swapped.

Evidently, the original code worked because the sign bit was set in accu 1H so that the following FDG worked correctly. This is the behavior described for the post 97 CPU.

We should probably castigate the person that wrote the code in the first place for not calling OB220 in between the -F and the FDG. So that would be... Err... Umm... Maybe me but it's much more pleasing to think that it might have been Scott or Maybe even Kevin.

When customers order "replica" machines, old code gets copied in and with it hundreds of bugs that you fixed years ago!

Nick
 
Reminds me of this......

canofworms.JPG
 

Similar Topics

I have an Siemens S5 135 system. The CPU 6ES5 928-3UB12 Will not go into run mode even after a MASTER RESET or AN OVERALL RESET using a...
Replies
2
Views
2,890
HI Dears, First of all sorry form my (English Words) and thanks a lot in ADVANCE. Im from PK. we have siemens Plc with single s135 Cpu 928, it...
Replies
4
Views
4,144
Hi, can any one help me, I have 2 Siemens S5 CPU cards, a 6ES5928-3UA 12 and a 6ES5928-3UB 12 does anyone know if these cards are interchangable...
Replies
2
Views
1,972
Hi, my name is Luciano from Brazil. I´d like to know if is it possible to make a back up of the program in a EPROM or RAM card to use with a CPU...
Replies
15
Views
7,123
I'm using the Siemens PRONETA software to do some IO testing currently. I love the simplicity and fast testing capability. Does anyone know about...
Replies
0
Views
64
Back
Top Bottom