Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - How to spawn proc on target from my Win App and exchange data while it runs.: (10 Items)
   
How to spawn proc on target from my Win App and exchange data while it runs.  
Hi. We've gotten QNX 6.3.2 installed on a Windows PC, and booted up NTO on another PC, compiled, downloaded, and remote 
debugged an application with Momentics. All very cool.
What I would like to do is download a target executable image to an NTO target process, and communicate data back and 
forth with the process while it runs on the NTO target, all from my windows application, not Momentics. Can anyone point
 me at some code examples for that? 
Or at least tell me what NTO calls will make it happen?
I gather it has something to do with pdebug, but I haven't found any good doc yet.
Re: How to spawn proc on target from my Win App and exchange data while it runs.  
You can use sockets, as on other unix systems.

Pete Darnell wrote:
> Hi. We've gotten QNX 6.3.2 installed on a Windows PC, and booted up NTO on another PC, compiled, downloaded, and 
remote debugged an application with Momentics. All very cool.
> What I would like to do is download a target executable image to an NTO target process, and communicate data back and 
forth with the process while it runs on the NTO target, all from my windows application, not Momentics. Can anyone point
 me at some code examples for that? 
> Or at least tell me what NTO calls will make it happen?
> I gather it has something to do with pdebug, but I haven't found any good doc yet.
>
> _______________________________________________
> QNX Momentics Community Support
> http://community.qnx.com/sf/go/post10209
>
>   
RE: How to spawn proc on target from my Win App and exchange data while it runs.  
Hi Pete:
	It sounds like you're moving from "debug" to "product"
orientation. Qconn / pdebug is really only used by the debugger.  It
provides means for downloading, stopping / starting processes and
retrieving information relevant to debugging and isn't meant to be used
as anything other than a debugging tool.

	What you need to do is to create an OS image that has your
executables in it. These executables can then be started as part of your
start up script.  All of this is covered in the documentation quite
clearly (see Building OS and Flash Images).

For communications, the common infrastructure between Windows and
Neutrino is IP (as in TCP/IP). This is, in fact, what qconn uses for its
communication.

	Using the socket API is covered in all its gory detail in many,
many places on the web (e.g.
http://en.wikipedia.org/wiki/Berkeley_sockets
)


	Robert.



-----Original Message-----
From: Pete Darnell [mailto:pete@vissol.com] 
Sent: Wednesday, July 09, 2008 12:02 AM
To: momentics-community
Subject: How to spawn proc on target from my Win App and exchange data
while it runs.

Hi. We've gotten QNX 6.3.2 installed on a Windows PC, and booted up NTO
on another PC, compiled, downloaded, and remote debugged an application
with Momentics. All very cool.
What I would like to do is download a target executable image to an NTO
target process, and communicate data back and forth with the process
while it runs on the NTO target, all from my windows application, not
Momentics. Can anyone point me at some code examples for that? 
Or at least tell me what NTO calls will make it happen?
I gather it has something to do with pdebug, but I haven't found any
good doc yet.

_______________________________________________
QNX Momentics Community Support
http://community.qnx.com/sf/go/post10209
Re: RE: How to spawn proc on target from my Win App and exchange data while it runs.  
A debugging tool is precisely what I'm after. I want to do exactly what gdb/pdebug/qconn do now. I definitely don't want
 to create an OS image with my process in it, I want to interactively download my executable to an existing Neutrino 
target just as Momentics/gdb does. 
I would rather not reinvent the wheel with sockets if I don't have to. Is the pdebug interface not documented?
Re: How to spawn proc on target from my Win App and exchange data while it runs.  
Pete Darnell wrote:
> A debugging tool is precisely what I'm after. I want to do exactly what gdb/pdebug/qconn do now. I definitely don't 
want to create an OS image with my process in it, I want to interactively download my executable to an existing Neutrino
 target just as Momentics/gdb does. 
> I would rather not reinvent the wheel with sockets if I don't have to. Is the pdebug interface not documented?

Pdebug 'talks' its own binary protocol; for communication it uses TCP/IP (sockets), serial line or std in/out. It would 
not be trivial to create your own client for pdebug. Qconn starts pdebug for debugging sessions. Maybe qconn has some 
higher level abstractions that would allow some scripting, but I am not too familiar with it, maybe Elena can give some 
insight.

However, if only downloading to the target is what you need, then you can use ftp. You will need ftp server on the 
target, and then you can use windows ftp client to transfer the binary to the target. 

If you need more control over your target, you can telnet to it and then you can run applications on it. If you want the
 connection to be secure, you can use ssh (but I think you would have to build it yourself, check our bazaar maybe there
 is a prebuilt binary).

What does this mean: "...and communicate data back and forth with the process while it runs on the NTO target"... what 
kind of data, and how is the communication done? Is it simply getting some input from command line and printing 
something as a result? If so, you can use ftp/Telnet combination described above.


I hope this helps, but your description of what you want to do is somewhat vague. Please provide more detail on what 
exactly you want to do. 



Re: How to spawn proc on target from my Win App and exchange data while it runs.  
Really I would think that simply running fs-cifs on your target and mounting a share on your windows machine would be 
easiest
to implement?  Then all your app needs to do it to telnet to your box and run the appropriate binary, loading it 
directly from
your windows disk.

Aleksandar Ristovski wrote:
> Pete Darnell wrote:
>> A debugging tool is precisely what I'm after. I want to do exactly what gdb/pdebug/qconn do now. I definitely don't 
want to create an OS image with my process in it, I want to interactively download my executable to an existing Neutrino
 target just as Momentics/gdb does. 
>> I would rather not reinvent the wheel with sockets if I don't have to. Is the pdebug interface not documented?
> 
> Pdebug 'talks' its own binary protocol; for communication it uses TCP/IP (sockets), serial line or std in/out. It 
would not be trivial to create your own client for pdebug. Qconn starts pdebug for debugging sessions. Maybe qconn has 
some higher level abstractions that would allow some scripting, but I am not too familiar with it, maybe Elena can give 
some insight.
> 
> However, if only downloading to the target is what you need, then you can use ftp. You will need ftp server on the 
target, and then you can use windows ftp client to transfer the binary to the target. 
> 
> If you need more control over your target, you can telnet to it and then you can run applications on it. If you want 
the connection to be secure, you can use ssh (but I think you would have to build it yourself, check our bazaar maybe 
there is a prebuilt binary).
> 
> What does this mean: "...and communicate data back and forth with the process while it runs on the NTO target"... what
 kind of data, and how is the communication done? Is it simply getting some input from command line and printing 
something as a result? If so, you can use ftp/Telnet combination described above.
> 
> 
> I hope this helps, but your description of what you want to do is somewhat vague. Please provide more detail on what 
exactly you want to do. 
> 
> 
> 
> 
> 
> _______________________________________________
> QNX Momentics Community Support
> http://community.qnx.com/sf/go/post10309
> 

-- 
cburgess@qnx.com
Re: How to spawn proc on target from my Win App and exchange data while it runs.  
If you want to do what qconn does you have to create you own binary that 
uses sockets - it is very simple
If you want to USE qconn to transfer data using different client on host 
site it is really easy too, what language do you want to write it on? I 
can send you perl script that can upload and launch on target using 
qconn daemon.

Pete Darnell wrote:
> A debugging tool is precisely what I'm after. I want to do exactly what gdb/pdebug/qconn do now. I definitely don't 
want to create an OS image with my process in it, I want to interactively download my executable to an existing Neutrino
 target just as Momentics/gdb does. 
> I would rather not reinvent the wheel with sockets if I don't have to. Is the pdebug interface not documented?
>
> _______________________________________________
> QNX Momentics Community Support
> http://community.qnx.com/sf/go/post10286
>
>   
Re: How to spawn proc on target from my Win App and exchange data while it runs.  
> If you want to do what qconn does use sockets - it is very simple
> If you want to USE qconn to transfer data using different client on host 
> site it is really easy too, what language do you want to write it on? I 
> can send you perl script that can upload and launch on target using 
> qconn daemon.

Thanks Elena. I want to do as little work as possible to get the job done. Using qconn would seem to be the best path if
 I can do it. C/C++ is my preferred language, but I'll take a perl script if that's what you have.

To give all you helpful folks the big picture, I am with Visual Solutions. We have an app, VisSim, which allows control 
engineers to draw diagrams of their control solution. VisSim can simulate the diagram which may contain differential 
equations, nasty feedback, digital filters, nonlinearities etc. We also allow C code generation from the diagram and 
automatic compile to a target app. Currently we target DSPs. The DSP solution allows automatic download to target, and 
lets the VisSim user provide inputs to target app via buttons, sliders from VisSim on PC Windows, and can view results 
from the target app via plots, meters, etc in VisSim. Historically, we have used JTAG and serial ports for this. We 
would like to extend this interface to QNX, and are looking for the best path.
Re: How to spawn proc on target from my Win App and exchange data while it runs.  
I'm interested in this as well, could you send the Perl script to me?

Thanks.
Re: How to spawn proc on target from my Win App and exchange data while it runs.  
Send me your email address (forum starts blocking it) at elaskavaia@qnx.com