Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: How to get the ruturn value?
Topic Summary:
Created On: 16-Oct-2007 10:00
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 16-Oct-2007 10:00
User is offline View Users Profile Print this message


chunjia wang

Posts: 39
Joined: 11-Oct-2007

hello,all!
     I have a question. How to get the ruturn value?
     I write a console application,the application send a message to dxlserver using C API supported by telelogic.
     I want to execute the dxl file ,and get the "Object Heading",and display "Object Heading" in my own application.
    how could I do?  thanks!
    

Report this to a Moderator Report this to a Moderator
 17-Oct-2007 19:18
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

Chunjia, One way would be to save the data to a file in dxl then read in your c app.

Another way may be write a socket in c compatible with DXL Interprocess communications.

Another way would be use ole automation, if you know how to connect to an OLE app in c.

Another way would be to write to windows registry and read with c.

Edited: 17-Oct-2007 at 19:22 by ron lewis
Report this to a Moderator Report this to a Moderator
 17-Oct-2007 20:44
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

One way to do it might be to set the clip board with the return values via setRichClip and then get the clipboard contents with C++.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 17-Oct-2007 21:12
User is offline View Users Profile Print this message


Reik Schroeder

Posts: 361
Joined: 28-Jul-2003

Hi chunjia,

you may use replyAPI function to return any string to sending host.
example for command line tool:

dxlips.exe "replyAPI \"print \\\"Hello World\\\"\""


Please refer to DOORS 8.1 API manual for more information on using DXL server.

Greetings
Reik

-------------------------
Evosoft GmbH
for Siemens Industry Sector


Berlin, Germany
Report this to a Moderator Report this to a Moderator
 22-Nov-2007 08:13
User is offline View Users Profile Print this message


Peter Schmid

Posts: 2
Joined: 25-Sep-2007

Hi Reik,

This only works in interactive mode. I'd like to do this in batch mode. Unfortunately replyAPI does not work in batch mode! Do you know a way make DOORS return a value? The clipboard approach is no alternative for me.

Thank you,
Peter Schmid
Report this to a Moderator Report this to a Moderator
 22-Nov-2007 09:37
User is offline View Users Profile Print this message


Frank Jensen

Posts: 24
Joined: 18-Sep-2007

Hi Peter,

why don't you use IPC as Ron already mentioned? It's a platform independant, should be available in every language and quite easy to accomplish.

I'd give it a try.

Cheers,
Frank

-------------------------
Frank Jensen
TRW Automotive
frank.jensenREMOVE_ME@trw.com
Report this to a Moderator Report this to a Moderator
 22-Nov-2007 09:38
User is offline View Users Profile Print this message


chunjia wang

Posts: 39
Joined: 11-Oct-2007

HI Reik,
I execute the code that you supplied.
dxlips.exe "replyAPI \"print \\\"Hello World\\\"\""

But dxlserver error.

dxlReply failed to send message : IPC is not connected

How to setup the ipc . Thanks
Report this to a Moderator Report this to a Moderator
 23-Nov-2007 06:35
User is offline View Users Profile Print this message


Reik Schroeder

Posts: 361
Joined: 28-Jul-2003

Hi Peter,

if I understand you right, you start the DXL-Server via Doors batch job?!

If you do so, you would need to use your own code like described in
DOORS 8.3 API manual - All Platforms

In the examplecode for batchmode there are already some send statements.
You may change line:
eval_ request
into
eval_ "IPC ipc = addr_"(int addr_ ipc)";\n"request

So you would be able to access the connection IPC ipc within the evaluated code


Greetings
Reik

-------------------------
Evosoft GmbH
for Siemens Industry Sector


Berlin, Germany
Report this to a Moderator Report this to a Moderator
 23-Nov-2007 07:14
User is offline View Users Profile Print this message


chunjia wang

Posts: 39
Joined: 11-Oct-2007

hi,all.
I read the "Doors API Manual" yestoday, the chapter about "Doos passtive link",then I did follow it's example. But failed.
step1 : I ran the file aip2init.dxl .
step2 : start the dxl server .
I put the code "initDXLServer server 5093" into the startup.dxl file.
step3 : form the commond line(cmd.exe),run $DOORSHOME/bin/dxlips "reply".
But recevied the dxlserver error message.
message: dxlReply failed to send message : IPC is not connected
client is not responding
Maybe I do not set up the IPC in my .cpp file ,but I do not know why. Thanks all.
Report this to a Moderator Report this to a Moderator
 26-Nov-2007 12:48
User is offline View Users Profile Print this message


Richard Good

Posts: 152
Joined: 22-Mar-2005

Chunja,
I don't think you are using the right approach. A much simpler way of sending things between doors and another application is to use the doorsdxl object that Telelogic provide, put a reference to this in your application then use the Result property to read/write information in the application and the OlesetResult and OlegetResult commands in DOORS such that you can easily pass information. I have used this technique to allow users to run dxls overnight on modules that are always locked during the day and for our customer supplier interface. I guess the run dxls overnight thing is the best example though, a brief description follows: -

I put the dxl filenames in column one of an excel spreadsheet and the descriptions in column 2
The spreadsheet loads itself into a listview on firing it up the user can then choose to run one or many of the dxl files by checking them, selecting a time and pressing the run button

Each DXL filename is sent from Excel to DOORS using the runFile command
it is sent once to check for dxl errors in the scripts - if there are any then they are written to the automation client by using the OleSetResult and retrieved by excel using the result property and the next text file is processed. If no errors are found then the file is actually ran and progress messages written using the OleSetResult command, attempts are also made to catch dxl run time errors and write them to the logfile and skip to the next file rather than halting. DOORs can also be shutdown and reopened if memory is getting low.

I find this technique good for applications that need to communicate with DOORS, I expect the api ipc technique is faster and more powerful (never tried it), but almost certainly adds a massive amount of complexity which probably isn't needed unless you are writing a very complex integration

-------------------------
Regards,

Richard Good
Report this to a Moderator Report this to a Moderator
 27-Nov-2007 00:58
User is offline View Users Profile Print this message


chunjia wang

Posts: 39
Joined: 11-Oct-2007

Hi, Richard.
Thanks very much . It works well I followed your approach.

But I need to research IPC,if someone have questions or suggestions,please Reply.
Report this to a Moderator Report this to a Moderator
 29-Nov-2007 09:48
User is offline View Users Profile Print this message


Peter Schmid

Posts: 2
Joined: 25-Sep-2007

Hi Reik,

This one looks really cool! A very helpful person gave me another hint. There is an undocumented overload of the replyAPI function, replyAPI(IPC ipc, string message). It works fine in batch mode.

But there is another problem. I found out that apiSend and replyAPI seem to be limited to messages with a length up to 2KB. Is there a way to circumvent this?

Thank you,
Peter Schmid
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 2 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.