klauer Posted April 10, 2013 Share Posted April 10, 2013 I'm having some issues with getting PLCs to programmatically kill a motor (that is, with its motor number in a variable -- I've tried L- or P- variables). It would appear that jogging and open-loop output also do not work this way. Is this a bug or is there something that I'm missing? open plc 8 local m_exp; m_exp = 3; P2 = 3; // Either of these lines abort the PLC ("Stopped on an illegal script operation code") kill P2; kill m_exp; // These do the same: cout P2:100.0; cout m_exp:100.0; // These do not cause errors, but also do not attempt to jog to the position: jog P2=1.0; jog m_exp=1.0; close Link to comment Share on other sites More sharing options...
Sina.Sattari Posted April 10, 2013 Share Posted April 10, 2013 try the following: open plc 8 P10=0 Ldata.motor=3; // sets motor 3 as target for this plc Kill; // kills the motor addressed by this PLC While(P10<1000) { P10++; } Jog=(P10); // jogs motor 3 to position P10 close Link to comment Share on other sites More sharing options...
klauer Posted April 10, 2013 Author Share Posted April 10, 2013 Thanks -- that appears to work. I missed that in the documentation. Link to comment Share on other sites More sharing options...
Recommended Posts