wehg Posted August 6, 2012 Share Posted August 6, 2012 Hello, Is there a way that I can issue a 'Quick Stop' command from a Cplc. The compiler doesn't seem to allow: Command ("&1\"); , and if I understand correctly the 'Direct Commands' are only allowed from the script environment? Yes/no? Thanks, Wehg Link to comment Share on other sites More sharing options...
bradp Posted August 7, 2012 Share Posted August 7, 2012 The issue is that in C the "\" character can mean other things inside a string. You have to tell the string that you want the "\" character so that it knows not to expect this to mean something else, like the start of a control sequence. A C language help guide should give the proper syntax such as this page http://linux.die.net/man/1/printf in which it says to get a backslash you must put it twice. So I think you will have success with command("&1\\"); Link to comment Share on other sites More sharing options...
wehg Posted August 7, 2012 Author Share Posted August 7, 2012 The issue is that in C the "\" character can mean other things inside a string. You have to tell the string that you want the "\" character so that it knows not to expect this to mean something else, like the start of a control sequence. A C language help guide should give the proper syntax such as this page http://linux.die.net/man/1/printf in which it says to get a backslash you must put it twice. So I think you will have success with command("&1\\"); Link to comment Share on other sites More sharing options...
wehg Posted August 7, 2012 Author Share Posted August 7, 2012 Thanks you! Link to comment Share on other sites More sharing options...
Recommended Posts