daves Posted March 12, 2014 Share Posted March 12, 2014 I cannot set UserAlgo.CFunc to 1 on my card. On a 1.5.8.0 card this is no problem. It means my CFromScript code will not run from a background PLC. What does CFuncStatus mean. It is not in the SRM, UG, or Help? $$$*** Resetting PowerPMAC PowerPmac Reset complete Please wait!!! database Sync in progress Database sync complete useralgo.CFuncStatus UserAlgo.CFuncStatus=0 useralgo.CFunc=1 useralgo.CFunc UserAlgo.CFunc=0 useralgo.CFuncStatus UserAlgo.CFuncStatus=-1 vers 1.6.0.30 Link to comment Share on other sites More sharing options...
daves Posted March 12, 2014 Author Share Posted March 12, 2014 If it is any help I have just seen it work on 1.6.0.0 Link to comment Share on other sites More sharing options...
daves Posted March 12, 2014 Author Share Posted March 12, 2014 Now I've found a 1.5.8.0 card that doesn't work. What are my steps for debugging this? Link to comment Share on other sites More sharing options...
steveneads Posted March 28, 2014 Share Posted March 28, 2014 I'd like to confirm daves findings. My system (v 1.6.030) always reports UserAlgo.CFunc=0. I've tried setting it =1 from the terminal window and in "pp_startup.txt". Neither works. However, despite this setting always being =0, if I try using a "CfromScript" call it works in some cases: Call from PLC 0 - yes OK Call from motion program - yes OK Call from PLC 1 (background) - not OK If I understand the manual correctly, none of these should work when UserAglo.CFunc=0! Can someone at DeltaTau explain what we are doing wrong - or whether it's in fact a system bug, and if so, whether it's being worked on? Thanks. Link to comment Share on other sites More sharing options...
sjlee5 Posted April 4, 2014 Share Posted April 4, 2014 I'd like to confirm daves findings. My system (v 1.6.030) always reports UserAlgo.CFunc=0. I've tried setting it =1 from the terminal window and in "pp_startup.txt". Neither works. However, despite this setting always being =0, if I try using a "CfromScript" call it works in some cases: Call from PLC 0 - yes OK Call from motion program - yes OK Call from PLC 1 (background) - not OK If I understand the manual correctly, none of these should work when UserAglo.CFunc=0! Can someone at DeltaTau explain what we are doing wrong - or whether it's in fact a system bug, and if so, whether it's being worked on? Thanks. Hi, "UserAlgo.CFunc=1" enables that the function can be called from background routines. If you do not set "UserAlgo.CFunc=1", you can access CfromScript from Realtime Interrupt ( RTI PLCs, RTICPLCs, kinematics, etc... ). And, as I know it's better to insert "UserAlgo.CFunc=1" in "global_definitions.pmh". Lastly, If you want to set "UserAlgo.CFunc=1", you should declare "double CfromScript(..)" in usrcode.c and usrcode.h and export Symbol. You cannot set "UserAlgo.CFunc=1" before declaring "CfromScript" function. I succeeded in the way described above. Link to comment Share on other sites More sharing options...
daves Posted April 4, 2014 Author Share Posted April 4, 2014 I think the purpose of CFunc was understood; to enable the CFromScript in BG tasks, this is just not what the manual states. The real point is not being able to set it. I have made a blank project declaring and exporting the CFromScript copied from the manual and still cannot get CFunc to be set to 1. There has to be something else going on and maybe CFuncStatus is the clue... Link to comment Share on other sites More sharing options...
Omron Forums Support Posted April 7, 2014 Share Posted April 7, 2014 I think the purpose of CFunc was understood; to enable the CFromScript in BG tasks, this is just not what the manual states. The real point is not being able to set it. I have made a blank project declaring and exporting the CFromScript copied from the manual and still cannot get CFunc to be set to 1. There has to be something else going on and maybe CFuncStatus is the clue... We identified the issue with this perticular problem scenario. If you keep using "Build and Download " OR build and Download RealTimeRoutines you will be able to set the useralgo.CFunc to 1 and use it correctly. For build and Download RealTimeRoutines option, select RealTime Folder and then right click to build and Download RealTimeRoutines fuction We will be fixing this in FW and IDE SW and release it as a patch. Thanks Atul Link to comment Share on other sites More sharing options...
Recommended Posts