SKA AB Posted April 4, 2023 Report Posted April 4, 2023 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? Quote
BE Posted April 4, 2023 Report Posted April 4, 2023 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. Quote
SKA AB Posted April 4, 2023 Author Report Posted April 4, 2023 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. Quote
BE Posted April 4, 2023 Report Posted April 4, 2023 (edited) 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 April 4, 2023 by BE Quote
SKA AB Posted April 4, 2023 Author Report Posted April 4, 2023 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. Quote
urvhalt Posted April 12, 2023 Report Posted April 12, 2023 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 Quote
urvhalt Posted April 12, 2023 Report Posted April 12, 2023 .. 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 Quote
urvhalt Posted April 12, 2023 Report Posted April 12, 2023 oh, you resloved it. lol. I have big glasses, missed that essential detail ;) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.