06-15-2009 10:07 AM - edited 06-15-2009 10:07 AM
Hi all,
I have seen some similiar posts to the following question I have, but I was hoping maybe someone could provide more detail as I am new to programming.
Currently, I have a Blackfin micropressor and a VisualDSP++ project used to communicate with our device. The project contains a mix of C and C++ functions/headers provided by Analog Devices.
I have a LabWindows 6.0 user interface created such that the user can click on buttons to tests portions of the device.
What I want to do is merge the two pieces of the puzzle, meaning allow the user to use the LabWindows user interface and have LabWindows use the communication program written in the various languages.
Can anyone explain to me in detail how this can be done....remember I do not know much about programming?
06-16-2009 06:43 PM
Hi Redseal 94,
I have a couple of follow up questions for you. I was wondering if you could clarify exactly what you meant by communication program. Does this run on the Blackfin Microprocesser or within Windows? Also, does the VisualDSP++ project have an interface to it?
06-17-2009 07:24 AM
Hi Kelly,
The communication program I refer to is VisualDSP++ code that I run in Windows that allows me to perform read/write, etc. to the Blackfin microprocessor. The VisualDSP++ has a user interface for me to write code, etc. but not a user interface to graphically control the Blackfin. What I want to do is have buttons, switchs, etc. that I can click on to turn on certain a certain pin on, etc. I have this GUI built in LabWindows and was hoping to be able to link the two together.
06-18-2009 07:46 AM
Hi Redseal,
As long as the VisualDSP++ Code is running on Windows, there may be ways to control it from CVI. Depending on what VisualDSP++ allows you to do, you have a couple of options: (I ordered them in the order that I would prefer to do them)
1. If VisualDSP++ allows you to create a DLL from your code, then its simply a matter of calling the DLL from CVI. This article discusses how to do this:
Developer Zone Tutorial: Calling DLLs in CVI: Explicit Linking vs. Implicit Linking (Dynamic vs. Sta...
2. If VisualDSP++ executables accept command line arguments, you could call different (VDSP++) executables based on what the user clicks in CVI and pass in the appropriate parameters.
3. If VisualDSP++ provides an ActiveX server that allows you to programatically build/run your code, based on what the user clicks in CVI, you can call the ActiveX server and tell VisualDSP++ to run your code.
06-18-2009 08:36 AM
Hi Jervin,
VDSP does not create DLLs, only .dlb. I do not know much about it, but I found a thread here (although it is for using a dll in VDSP, not creating one):
http://www.blackfin.org/phorum/read.php?6,9063
I am not sure about your #2 option.
It may run ActiveX, although I am not entirely sure. I looked in the help section and this is all that was found:
"
Enabling a Plug-In
VisualDSP++ can be configured to include ActiveX control, called plug-ins. A plug-in must first be enabled before you can run it.
An enabled plug-in typically provides a menu command from which to run the plug-in, yielding an associated window.
When plug-ins are installed on your system, you can:
View a list of installed plug-ins
View a description for each plug-in
Enable or disable individual plug-ins
To enable a plug-in
From the Settings menu, choose Preferences.
The Preferences dialog box appears.
Click the Plugins tab.
A list shows each the status for each plug-in (enabled or disabled).
Select the plug-in you want to enable.
The description for the selected plug-in appears in the Description box. "
06-18-2009 09:16 AM
A low rent solution I find very useful in such situations is to use a shared file. Memory mapping it will be most efficient if both applications support it (anything that supports SDK calls will), but regular file reads, writes, and seeks is surprisingly efficent these days. I use this trick to have a CVI application control a Linux application across a network connection via the Linux system SAMBA file sharing.
Syncronization can be an issue if data flow is truely bidirectional, but if communication is mostly one sided, i.e. commands from CVI, results from the foriegn application, the natural stimulus-response "handshake" usually suffices. Since both are on Windows you could set up a Semaphore for real syncronization, but if you can do this you can probably use shared memory as well.
--wally.
06-18-2009 09:18 AM
06-19-2009 12:09 PM
Hi Redseal94,
As wally_666 said, you have two options here. You can either go the shared memory route or the shared file route. The shared memory method is a bit more complex and riskier, so I would recommend the shared file method. Basically, what this entails is to open a text file from CVI and write a command to it when desired. You are then going to control your DSP++ program to open this file and read from it. If it contains a command it will execute that command.
06-19-2009 12:11 PM