Borland C++ samples [WebWare SDK]
Comments
-
Hello,
I couldn't help you with a Borland sample, but here is a VC++7 sample created on VS.Net 2003. Does anybody else out there use Borland?
It is very simple. You need an alias called S4 configured in Interlink and running (the Virtual Controller is fine). When you run the application, several controller state data items will be displayed to the UI. When the controller's operating mode is changed, the relevant fields will be updated.
Note: the comboBox does not have any event handlers wired to it, so clicking on it will have no affect.
RussD38083,9371412037Russell Drown0 -
Thank's for the VC++7 sample.
Unfortunaly it didn't solve my problem. I can read the status of the controller but I can't send commands like for example "Load a program", "Start a program" or even put it in "Run Mode".
I've added to the VC++7 sample a button with de following code:
{
int __gc *ResultID;
axHelper1->S4Run(3,ResultID);
axHelper1->S4Start(0,"main",-1,1,3,ResultID);
}
When I push the button the application returns an unhandled exception.
So, if you could send me a small example on how to put the controller in Run mode and how to start a program, I supose it would solve my problems.
Thank you once again!
ESTV0 -
Hello,
I was able to duplicate the condition you reported above. You can avoid this behavior by using an int instead of the int __gc, and passing the argument by reference.
For example:
private: System::Void btnMOn_Click(System::Object * sender, System::EventArgs * e)
{
int ResultID = 0;int intRetVal = 0;
short ResultSpec = 0;
try
{
intRetVal = axHelper1->S4Run(ResultSpec, &ResultID);
}
catch(Exception *e)
{
lblFileName->Text = e->ToString();
}
}
I think that this will get you past the overall problem you were experiencing, I will post a more detailed sample as time permits.Russell Drown0 -
Thank you. The program works fine now on Visual C++ .net.
As for Borland, the problem should be very similar. I can already do whatever I want to, except commands like S4Start that use a parameter of type wchar_t (also know as type BSTR).
S4Start(short pgmId, wchar_t *procedure, long noOfCycle, long runMode,short ResultSpec, long* ResultID);
I'me declaring the procedure parameter like this:
wchar_t *procedure=L"main";
but when executing it returns an error of some sort.
If anybody can tell me something about this it would be great, otherwise I'll have to manage with Visual C++ .NET
Thank you, one more time!!!
ESTV0
Categories
- All Categories
- 5.5K RobotStudio
- 395 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings