Posted 12 May 2023 (edited) Hello fellow members, It’s Beaning a wail that I have post on this form. But i need some help. I have experience with programming plc in ladder and function blokes. But not whit structured tekst. I have made a recipe so that the machine can switched easy to divert parameters. No I have problem whit the ‘default settings’ for some parameters that van be de basic when something goes wrong. Can anyone tell me wot I do wrong I have sent son screenshot to help you understand what I mean. Thank you in advance Device varible to device is not a problem Not varible to device is a problem For example what i mean whene I make it in ladder. Edited 12 May 2023 by A.J more informatie Share this post Link to post Share on other sites
Posted 15 May 2023 (edited) Haven't checked the code but there is a space before the 10. Could be the issue. which PLC are you using and which software ? Hmm checked with GX 2 but it compiles without any problem Edited 15 May 2023 by Gambit Share this post Link to post Share on other sites
Posted 16 May 2023 Hello Gambit, Sorry for a very late reactie, I have binne pretty busy. But a use a fx5U plc and GX works 3. I have use a space betore 10. If i got time tomorrow i willl check to be sure. Share this post Link to post Share on other sites
Posted 17 May 2023 hi Gambit, on the back of this, I am using ST on FX5 to do some maths with floats, in your opinion, does Mitsi have anything to help me separate the result into 2 groups. 1 where digits on left of coma are stored, 2 right to coma. so for example, after a calculation I get a float of 2.34, how can I separate 2 from 0.34. The PLC needs to see that has to multiply 2 by 7, then 0.34 by 128. Cheers. Share this post Link to post Share on other sites
Posted 17 May 2023 1 hour ago, FRANK RUIZ said: hi Gambit, on the back of this, I am using ST on FX5 to do some maths with floats, in your opinion, does Mitsi have anything to help me separate the result into 2 groups. 1 where digits on left of coma are stored, 2 right to coma. so for example, after a calculation I get a float of 2.34, how can I separate 2 from 0.34. The PLC needs to see that has to multiply 2 by 7, then 0.34 by 128. Cheers. DEBCD(P) will seperate the exponent and the mantissa part. But if you convert the Real number (2.34) to an integer value (FLT2INT) you will get an integer value (2). turn that back into a float INT2FLT and subtact that from the origional with DESUB(P). you should have your remainder (0.34) 2 people like this Share this post Link to post Share on other sites
Posted 17 May 2023 4 hours ago, Gambit said: DEBCD(P) will seperate the exponent and the mantissa part. But if you convert the Real number (2.34) to an integer value (FLT2INT) you will get an integer value (2). turn that back into a float INT2FLT and subtact that from the origional with DESUB(P). you should have your remainder (0.34) thanks a million! Share this post Link to post Share on other sites
Posted 17 May 2023 On 15-5-2023 at 10:05 AM, Gambit said: Haven't checked the code but there is a space before the 10. Could be the issue. which PLC are you using and which software ? Hmm checked with GX 2 but it compiles without any problem Hello Gambit, I Have done somthing wrong begos me reply dit get on the form. So i trie a gain. I use a FX5U, and GXWorks 3 I have ols seen that I have space bewteen de the 10 and i have space. I tried it wit a different device that works, verry odd I think Share this post Link to post Share on other sites
Posted 22 May 2023 Which Dev did you have before and into which device did you change it ? Share this post Link to post Share on other sites
Posted 23 May 2023 I don't change a Dev but I add a Dev. I add Dev D200 to test i that works, and that works. thats wy I think its odd that it doessent works white the label name Share this post Link to post Share on other sites
Posted 1 Jun 2023 The problem was dat I not use the recept nummber in watch dog. But i use the basis. Thit use Recepten[Recept.Pointer].aantal_pot_in_laag most use; Recepten[17].aantal_pot_in_laag Thank you Gambit Share this post Link to post Share on other sites