Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

passing data between programs

Status
Not open for further replies.

Old Nick

Advanced Member level 1
Joined
Sep 14, 2007
Messages
479
Helped
68
Reputation
136
Reaction score
18
Trophy points
1,298
Activity points
4,243
Hi,

I'm controlling a AFG3102 using straight C with a win 32 console application.
The program that I'm captuiring the data with and displang experiment results graphically and in real time is a windows application (again in straight(ish) C). Tektronix don't supply any info/libraries that work with a windows app, so as far as I can tell I need to send information between 2 seperate applications.
It's not a lot of info that has to be passed, the windows app needs to tell the console app to increment the phase on the sig gen, and it has to know when that has been sucessfully completed.

I have no idea how to do this.

Cheers,

Nick
 

there are many ways:

1) using tcp sockets: application A can open a TCP or UDP socket on port XX an application B connects to that port XX and sends information

2) using files: application A opens a file with a known filename by both applications, and application B reads that file.

3) using environment variables: application A updates an environment variable with the data needed and the application B reads it

... and much more that right now i can't think about...
take a look at IPC (interprocess communication): https://en.wikipedia.org/wiki/Inter-process_communication
 

I thought about using files, but it just seems a bit of a nasty solution.

I have no idea how to change an environment variable. I'm in similar situation with the sockets.

it sounds like all of those methods rely on both applications polling 'something' continually to see if there has been a change. I'm not to keen on this. Is there no way that a Windows app can create/call a console app and control it without the need for continual polling.

I'm an analogue electronics kind of guy, and only have a working knowledge of C. I know no C++.
 

in windows terminology, it's named as IPC.
pls check Windows SDK for detail.
=====================================================
Interprocess Communications
The Microsoft® Windows® operating system provides mechanisms for facilitating communications and data sharing between applications. Collectively, the activities enabled by these mechanisms are called interprocess communications (IPC). Some forms of IPC facilitate the division of labor among several specialized processes. Other forms of IPC facilitate the division of labor among computers on a network.

The following IPC mechanisms are supported by Windows:


Clipboard
COM
Data Copy
DDE
File Mapping
Mailslots
Pipes
RPC
Windows Sockets
 

Of course Tectronix doesn't supply any functions that are windows specific. Why would they? The functions would be specific to sending and receiving data over a communication channel, in this case either lan, usb or GPIB. If there is an API for it, it is probably written in strict ANSI C and is probably portable across all major platforms. I would go through the manual and find the API function calls. From looking at the spec sheet I see it has lan, usb and gpib built into it. lan is probably the easiest way to go. Use sockets to initialize and access the 3102's built in lan subsystem. I am sure that setting the phase is a simple one line command.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top