Problem Setting Digital Outputs Using Windows API

9 years 2 months ago #29525715 by CheckMark
Hi,

I have a Roboteq HD2450 Motor Controller and use a C++ program running on a Windows PC to control it. I have no problems getting data from any of the inputs or setting the motors but when I try to set any of the digital outputs SetCommand() returns 16 (RQ_SET_COMMAND_FAILED).

This happens with all of the following command items:
_DOUT
_DRES
_DSET


I have tried SetCommand() with _GO as well as _ESTOP and both those command items work fine.

Switching the digital outputs on/off in RoboRun+ also works fine.

I have no idea why it is failing, and any help getting this resolved would be greatly appreciated!

Thanks,
Mark

Please Log in or Create an account to join the conversation.

9 years 2 months ago #29525729 by roboteq
The API just sends the command and argument to the serial or USB port. To make processing faster, the command is replaced by a hex number as find in the header file.

So to set digital output1, the API sends \"!$0A 1\\r\". When sending this via the console, it works.

Try sending this to your controller via the console. If it works for you then there may indeed be a problem with the API when sending a single argument command. Try other single argument commands and report.

Please Log in or Create an account to join the conversation.

9 years 1 month ago #29525827 by roboteq
There was a problem with the API when sending commands with only one argument.

Please try the updated version dev.roboteq.com/dev1/files_n_images/file...api-linux-080411.zip and report.

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 3.569 seconds