Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

Communication JLink <-> Toolkit

frage29

New member
Hello all!

I tried to control a Java Swing GUI with Toolkit and to interchange data between this GUI and Toolkit. But each intent to establish such a connection failed.
It is important, that ProE initiates the connection.
Is there any good example for that problem?

I read that it is only possible to use Java 1.4.1. My GUI is written in Java 6. Is there any possiblity to use 6?

Thanks a lot!
frage29
 
frage29,


Read the Pro/TOOLKIT API Wizard under User's Guide->Task Based Application Libraries. This section will explain to you how to communicate with a J-Link application. There is a similiar section within the J-Link documentation on how to communicate with Pro/TOOLKIT. Basically you acquire a handle to the other application and then call functions within that program.
 
williaps,

thank you for your answer!

Exactly this I did. My Jlink Application looks like this:

public static void start ()
{
try
{
taskID = "1111";

Session curSession = pfcGlobal.GetProESession();

TestListener listener = new TestListener();

curSession.RegisterTask(taskID, listener);
...


public class TestListener implements JLinkTaskListener
{
public Arguments OnExecute(Arguments arg0) throws jxthrowable
{
try
{
Arguments content = Arguments.create();
ArgValue argV1 = pfcArgument.CreateDoubleArgValue(100);
ArgValue argV2 = pfcArgument.CreateDoubleArgValue(200);
ArgValue argV3 = pfcArgument.CreateStringArgValue("test");

Argument arg1 = pfcArgument.Argument_Create("0", argV1);
Argument arg2 = pfcArgument.Argument_Create("1", argV2);
Argument arg3 = pfcArgument.Argument_Create("2", argV3);

content.set(0, arg1);
content.set(1, arg2);
content.set(2, arg3);

return content;
}
...

I suppose that to start a task i have to use the function ProJlinkTaskExecute in Toolkit. I didn
 

Sponsor

Back
Top