SKA AB

Function block, input is True, inside it is false

8 posts in this topic

Hi, i have this function block to clamp/unclamp items.

On the outside, i have a bool that is set to true (as in it should clamp), but inside the function block, the Clamp is false.

This is in the simulation, any idea why it is not true inside the FB?

TrueIsfalse.thumb.png.7213aa8c4df898853e

Share this post


Link to post
Share on other sites

Is it definitely the same instance of that function block?

I changed the clamp input to a test bool (so I could turn it on and off easily), and it showed up inside the block fine.

Share this post


Link to post
Share on other sites
42 minutes ago, BE said:

Is it definitely the same instance of that function block?

I changed the clamp input to a test bool (so I could turn it on and off easily), and it showed up inside the block fine.

I've checked both front and back clamp, and neither shows Clamp is true, which is odd to me.

Share this post


Link to post
Share on other sites

 

43 minutes ago, SKA AB said:

I've checked both front and back clamp, and neither shows Clamp is true, which is odd to me.

Out of curiosity, if you just change it to a regular bool (not a structure member), does it do the same thing? (ie. using a test bool you manually turn on and off)

Edited by BE

Share this post


Link to post
Share on other sites
1 hour ago, BE said:

 

Out of curiosity, if you just change it to a regular bool (not a structure member), does it do the same thing? (ie. using a test bool you manually turn on and off)

When i now started the simulator up again to test this, the current code works.. The sysmac simulator seems really wonky sometimes.

Share this post


Link to post
Share on other sites

a)   Is there a task, for the section to actually  execute?      If not executed, nothinggets in/out the fb instance

 

b) similar - is the PLC running or stopped?   :)     If stopped, nothing get in/out the fb instance

 

 c)   Try a full download instead of sync, to ensure PLC is running your program.   Sometimes - maybe on slow computers,  i have seen programs be synced before they have been fully compiled in the background.     Waiting a little, syncing once again - and surpiringly, it has something to sync..    

 

D)  insert some simple counter  to detect if signals are flickering, and you do not se it.    A simple counter can also be used to check that the code are actually running  =   counter counts every scan or such.  ( With counter i mean  an integer and the + instruction adding 1  )

 

Kind regards / Patrik

Share this post


Link to post
Share on other sites

.. also, if using several fb instances of that fb prototype:   ensure not to have specified the same instance twice  ( that is a typical result of  copying some code / sections - and forgetting to change the instance names on the copied code. ).  In that case, you probably only see the result of the last execution of the duplicated instance.     For example - if you alse have backTrayClamp,  did copy it from FrontTrayClamp,  and forgot to change the instance to be instance  BackTrayClamp.  In that case fbi FrontCTrayClamp will execute once for the fronmt tray,   and once for the back tray   and you will only see monitored data that relates to the back tray.       Kind regards / Patrik 

Share this post


Link to post
Share on other sites

oh, you resloved it. lol.  I have big glasses, missed that essential detail ;)

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