Calculations in gx iec developer

AndersW

Member
Join Date
Jan 2010
Location
Sweden
Posts
24
Im writing a minor system with a puls sensor and where the user of this system can put in values in MM now i need to recount this to pulses and i cant get it to work

basially I need to have value in mm(D0)-constant in mm(D1) and then the new value (D2) * with pulses per mm(D3)

I started using the sub function but i end up getting really wierd values when i check this

is there an easy way to do this? also preferably without having to add a lot of extra registers for the calc of the last part

sub function with the answer to add function would be really nice

would love if anyone could help me with this, thanks in advance
 
I suggest you let us know which mitsi plc your using and post a shot of your maths code or better still zip the prog or part of it up and post it here and you will get a better faster response especially from the Mitsi fans (saying no names :) )
 
picture

gxiec.jpg


Had to upload it but this works
 
Last edited:
This is what id like to do but i cant even get a value that makes sense coming out of the sub function if I put a register as output when I try it
 
What registers have you got to the input of the sub and what have they in them ?

(Im not a mitsi fan (n) but as the mitsi boys seems to be down the pub with their ties ill chip in !)
 
basially I need to have value in mm(D0)-constant in mm(D1) and then the new value (D2) * with pulses per mm(D3)
so basically you want
(D0 - D1) * D3 = Result

If so why are you using 'ADD', try MUL
 
Originally Posted by AndersW
This is what id like to do but i cant even get a value that makes sense coming out of the sub function if I put a register as output when I try it
Originally Posted by AndersW
DINT variables, and i guess they should have started at 0 but they didnt for some reason
Would like to see what feeds the D registers, he may be overlapping registers using Dint's, try seperating D0 then D2 etc
 
Yes, thats what i thought, which is why i asked what registers he's using exactly. Been 2 years since i touched GX now though *TOTAL BLISS* so was having trouble remembering :)
 

Similar Topics

In a safety circuit it's clear how to use sistema or similar to calculate the PL given hardware components. But how are various degrees of pure SW...
Replies
4
Views
94
I know this isn't PLC related, thanks for bearing with me. Does anyone have an excel sheet to calculate full load amps for branch circuits? Im...
Replies
0
Views
719
Has anyone had any experience with calculations for SRML wire. I have searched through all the articles I can, googled it and even talked to...
Replies
4
Views
1,695
Hello experts, I'm making my first steps in hydraulics and recently I have come across to a very old thread in which the following task was...
Replies
14
Views
3,064
Hi All, I have a task to decipher a calculation done by one of our S7 PLC's onsite. The problem being that its in statement list, and this...
Replies
4
Views
1,854
Back
Top Bottom