Skip to main content
Submitted by sureshnjoy4ever on Wed, 08/30/2017 - 08:41

Hi Sir,

This is Suresh. I am using Microsoft Visual C++ to write GUI based MFC applications in C++.

I am having small issue with using WT or Am commands. I am running the motor with PA command and before executing next PA / BG command, I want to make the controller wait for 1 second. So, I tried to use "gCommand("WT 1000")" in my code. When I run the application, I got an error message "str = "2010 COMMAND ERROR. Galil::command(\"WT 5000\") got ? instead of : response. TC1 returned \"2 Command only valid from program\"\n" ". I did not really understand the meaning of "Command only valid from program".

Request you please help me in solving the above issue.

Thank you.

Comments 1

AndrewS on 08/31/2017 - 13:57

Hi Suresh,
The DMC can run local code downloaded to it's program memory space. This can be done with GDK. AM and WT are only valid in this manner.

The other way to code using the DMC, is to send commands to it, similar to typing commands in the terminal. This is what your C++ program does. The trippoint commands (commands that wait for something to happen) are invalid in this manner. Instead, you need to write your own while loop that checks a parameter.

For AM, you can check _BGm. For WT, you can use your PC's timer, or look at the TIME operand.

If you have additional questions, I would recommend calling in or emailing support@galil.com.
Regards,
Andrew