A.J

structerd tekst Structured tekst

10 posts in this topic

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

Device to device goes good.PNG

Not varible to device is a problem

Not variable goes wrong.PNG

 

For example what i mean whene I make it in ladder. 

Example in ladder.PNG

Edited by A.J
more informatie

Share this post


Link to post
Share on other sites

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 

 

Screenshot 2023-05-15 101545.jpg

Edited by Gambit

Share this post


Link to post
Share on other sites

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

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
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
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
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 

 

Screenshot 2023-05-15 101545.jpg

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

Test D200 werkt wel.PNG

Share this post


Link to post
Share on other sites

Which Dev did you have before and into which device did you change it ?

Share this post


Link to post
Share on other sites

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now