RS500 Double integer ?

Originally posted by Peter Nachtwey:

On a SLC5xx the 32 bit number can be loaded into the special 32 bit register and do a divide using the DDV (I believe) instruction.

That is correct. But it is the ONLY instruction that will operate on a value already in S:13 and S:14. MUL will correctly extend into S:13 and S:14 but ADD and SUB will not. So you can't increment a 32-bit quantity directly.


Originally posted by Peter Nachtwey:

2^32=4294967296 which has a range much greater than 999,999,999.

Also true. But if I am counting 4 events a minute, every minute of every day, 999,999,999 gives me just under 500 years of continuous operation. So while 4294967296 is certainly greater than 999,999,999 that MAY not be germane to the conversation.


Originally posted by Peter Nachtwey:

PLCs should support both signed and unsigned math.

Again, I couldn't agree more. But my '96 Saturn SL should get 50 MPG and do 0-60 in 9.5 seconds, too. Just because I want it to be true doesn't mean I don't have to work with what I have.


Originally posted by Peter Nachtwey:

Today you should simply buy a more powerful PLC and avoid the hassle.

Absolutely. And not even necessarily more powerful, as you pointed out. Just one that doesn't artificially limit the processor it already has. And I agree for new applications. But for an existing application I can do alot of messing around with software methods for what it would cost me to replace the plc and I/O, redraw the schematics and transport the program.

You can do 32-bit extended integers in the SLC but you have to babysit the sign bit of the LSW at rollover by yourself. If you are just looking to do an increment it isn't bad. But the easiest implementation for most people seems to be the multiple register idea from robo77. As long as the range isn't huge and you know how to display it on an HMI it usually works OK.

Keith
 
maybe it's just me.. but I take the simple way.

I use 2 or even 3 integer files for larger numbers.

add 1 to item1..when reaches 999 increment item2 - zero item1
add 1 to item3 when item2 reaches 999 - zero item2
zero item3,item2, item1 when item3 it reaches it goal

gives me 3 integer files. item3,item2,item1 (999,999,999)

just gotta display it right :)

keep adding integers to get to the largest digit you want.

now this makes calculations with that number kinda odd. btw. but it can be done.

I like that...easy and simple :)
 
PLCs should support both signed and unsigned math.
I would have gone into this years ago but it became irrelevant with the advent of 32bit PLCs. Today you should simply buy a more powerful PLC and avoid the hassle.

absolutely true when you can but actually the customer insist to use this old SLC model....

If i had choice, i would have used an S7-315 or a S7-224 that support 32bits but....The 200 doesn't support enough modules and the customer bless AB (or get good advantage of using it...)

(Remember the time where PLC was only using HEXA instead of decimal.....!!);)


So because it is just for an hour meter count, i will continue incrementing a float by 0.01 hours every 36 sec count and limit it lower to 99 999.99 before resetting it (+/-11years) to 0 after that.
A test let me see it stop to counting after 262 144.0.....so it will work fine....

I was usually let it run until 999 999.99 to get over 100 years but 11 should be enought to accept a reset after this delay and start again
 
A float has a 23 bit mantissa plus an implied 1, giving you 24 bits. 24 bits can represent the value 224-1.

That means that a float can represent a whole number up to 16,777,215. Beyond that the float looses resolution in the one's column. You could not represent the number 16,777,217.

Floats can represent much larger numbers with a loss of precision, for example if you were counting by tens (or more) then you can count to a larger number. The largest number that a float can represent is 1.7e+38 but its precision will be 2.028e31. If you don't mind counting by a few quadrillion quadrillions then I'd say that is pretty useful:beer:.

More information on the IEEE-754 float format and its limitations can be found here.
 
Dosomat 10.3 - Waldner, you need eeprom input display

hello. dosomat packaging machine's 10.3 Waldner, 28C64 eeprom requires input to the display panel. I read the contents and is clean - FF. Maybe someone has access to the the display - the type of Anka's Wohl, or has a similar display the contents of eeprom. Please inform the church, very urgent. Regards.
 
I have never understood why the SLC platform does not have DINT math. For an hours counter I always use DINT in GE and Siemens. I use robo77's method and count seconds, minutes, and push to hours. For the SLC I also use robo77's method.

It would be more accurate to compare system time but I never took it that far.

With floats there are rounding errors, with DINT's - never. Hasn't anyone ever seen a float in Siemens get corrupt somehow? I have seen this in systems that have worked for years. All of a sudden a compare will fail. The value in the float is really wierd, like if you modify it with a VAT and write an integer value to the float address. Very strange. DINT's are better for accumulating "one" than a float.
 
Last edited:
hey paul I understand the errors.. thats why I use my own RTO to add to the counters... but truly I don't even understand the above request..lol

actually got a "kick" out of trying to read it.
 

Similar Topics

Hi, I'm having trouble with a program that was converted from PLC2 to SLC500 by a contractor. There is a double coil (latching). I'm trying to add...
Replies
29
Views
7,557
Hello I am trying to make a program work with a sqo instruction .The process has 5 steps ,and a starting step of zero.There should be 8 sec...
Replies
17
Views
1,067
I have upgraded an old RS500 project to Studio 5000, it has thrown multiple errors which I am currently working through. I have looked through...
Replies
8
Views
1,730
I am working on upgrading a system with a ML1500 that uses a 1769-SDN DeviceNet Scanner to a CompactLocix L24ER-QB1B. Due to cost, I need to...
Replies
2
Views
1,406
I have been ask to check if we can have both English and Chinese in the same I/O description text window and rung comments. I could not Chinese to...
Replies
2
Views
1,218
Back
Top Bottom