4/28/2024 10:12 PM | |
Joined: 4/27/2024 Last visit: 4/28/2024 Posts: 3 Rating: (0) |
Thanks for the tip. I changed the structure to what you suggested and recorded some traces, one attached. Notably: REQ and BUSY, and my one-shot signal are never recorded in the trace. I have my recording settings as "every 1 cycle", so I'm not sure why it's not properly recording these values. MB_ERROR is always 1. The STATUS when "idle" is 818B which per the documentation means: The MB_DATA_PTR parameter has an invalid pointer. You should also check the values of theMB_DATA_ADDRand MB_DATA_LEN parameters. However, for one cycle only, the STATUS changes to 7004 which is: Connection established and monitored. No job processing active. The MB_State goes to 4 for one cycle on the good executions, and to 5 for one cycle on the bad executions. But there is no documentation on what these states mean. It looks like I'm not setting up my MB_DATA_PTR correctly, even though it works half the time, and that's where I'll focus. I have to say that as a beginner to PLC programming (not a beginner in general programming) it's very unclear how you're supposed to pass this parameter to the FB. I have a static variable in the FB that contains my MB_CLIENT FB, it's not clear how to get the pointer to this variable. I tried using an array and putting my value in the [0] address of the array, and passing the unindexed array to the FB, but I get the same STATUS code from the MB_CLIENT block. I also tried disabling the "optimized block access" from the FB, no results yet there. I'll report back if I figure it out, any pointers pun intended are appreciated.. |
Follow us on