Fiddeflygare
Member
Hi everybody i am currently working with a project at my company and i have spent mostly of the evening yesterday and the morning today trying to get an answer to my question with no luck by searching the help texts, manuals and internet (Google) with no luck . I am programming a machine where the customer must be able to program a couple of different variables where two of them are the lenght of the used raw material and how long one part made of the material will be.
Now the problem i have are that they want the machine to calculate how many meters of raw material the machine will use for his order of say 100parts that are 320mm long. The rawmaterial they most commonly use comes in 4m lenghts and this give me a problem. The calculation of this gives me 12.5 parts per 4m raw material and that it will need 8.3 4m lenghts for the order to be completed. Now to my question: Is there any way to make the PLC round down the 12.5 parts per raw material to 12 and round up the 8.3 raw material lenghts to 9?
I am currently programming a Rexroth indradrive C MLD and i am using REAL variables for the calculation, i am programming most calculations in ST but if the solution lies within programming in FBD, Ladder or any other language i am all ears. Anyone knows how to solve this problem?
Thanks in advance for your help.
Best Regards
/Fidde
Now the problem i have are that they want the machine to calculate how many meters of raw material the machine will use for his order of say 100parts that are 320mm long. The rawmaterial they most commonly use comes in 4m lenghts and this give me a problem. The calculation of this gives me 12.5 parts per 4m raw material and that it will need 8.3 4m lenghts for the order to be completed. Now to my question: Is there any way to make the PLC round down the 12.5 parts per raw material to 12 and round up the 8.3 raw material lenghts to 9?
I am currently programming a Rexroth indradrive C MLD and i am using REAL variables for the calculation, i am programming most calculations in ST but if the solution lies within programming in FBD, Ladder or any other language i am all ears. Anyone knows how to solve this problem?
Thanks in advance for your help.
Best Regards
/Fidde