steveneads Posted February 20, 2015 Share Posted February 20, 2015 Please discount the comments below - except as a memory jogger to other users! I found that the problem was that I was setting Sys.WpKey = $AAAAAAAA too late in my code! Hi I have a pp_Startup.txt file which contains the following lines: UserAlgo.CFunc=1; enable plc 1; //initialise settings and start test control logic //system "/var/ftp/usrflash/Project/C Language/Background Programs/capp1.out" In my PLC 1, I have the line: Gate3[0].Chan[0].EncCtrl = 3; After power up or a $$$ I find repeatably that Gate3[0].Chan[0].EncCtrl = 7. It's not being set this way in my code (I've searched the whole project). I am pretty sure that PLC 1 does run during the startup as other value that it sets are correct. If I manually enable PLC 1 again, the value is set correctly to 3 as expected. It seems to me that something else is being run at startup after PLC 1 runs and this is resetting my value. Is this possible? Any suggesteions as to what to look for? Thanks. Link to comment Share on other sites More sharing options...
bradp Posted February 20, 2015 Share Posted February 20, 2015 I would do this quick test with two unused p-vars In my PLC 1, I have the line: Gate3[0].Chan[0].EncCtrl = 3; p1=Gate3[0].Chan[0].EncCtrl p2++ Link to comment Share on other sites More sharing options...
Recommended Posts