02-04-2014 06:50 AM - edited 02-04-2014 06:53 AM
We have an experimental radar system to which we will add a cDAQ unit runing Windows.
cDAQ will be responsible for doing RF output testing and other stand-alone tasks. Incl. personel safety.
The existing software for radar control, data aquisition and presentation, running on three different PC's, is written in Delphi.
Communication across LAN is currently done using UDP and small virtual files called Mailslot. Internally on each PC Windows messaging is in heavy use.
How do I interface existing Delphi software to a new LabView app. on the cDAQ?
The data to be transfered will mostly be message like. I.e. short commands and status values, like trippoint for max transmitted RF power and actually meassured transmitting RF power. Some of these measurments received from cDAQ are to be entered into the data stream to disc. (File header parameters)
My LabView skills are in general novice. For Delphi they are somewhat higher
Is it easier to have a small LabView app. running on one of the PC's to handle the LAN communication and from there interface locally?
Do it the other way around with a small Delphi app. on the cDAQ?
Or how to do the interface directly?
02-21-2014
06:24 AM
- last edited on
08-14-2024
09:56 AM
by
Content Cleaner
Hi Walker12.
Welcome to the forum. How is it going with your application?
NI does not have any drivers that will work with Delphi. However, we do have support for other text based languages such as C++ and C#. For examples, how a look at this whitepaper:
Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications
One idea could be, to develop the data acquisition in LabVIEW and use UDP to do the communication between LabVIEW and Delphi. I have attached an example (that is also included in the standard LabVIEW installation), that shows how to use UDP in LabVIEW. Open the two functions called "UDP Receiver" and "UDP Sender" and follow the instructions.
Another way of communication between these two languages, is to write the data to a file, that gets read in by Delphi.
Let me know if I can help you any further.
02-24-2014 04:17 AM
Redoing 10+ years of Delphi programming in LabView does not look like an option. certainly not with my LabView skills, or the time frame at hand.
I know LabView somehow can be made to send and receive Windows messages, so using a small Delphi app on the cDAQ to handle the link down is an option.
We have a skilled LabView programmer, but he is busy elsewhere and can only be called on for short questions.
He does not know anything about Windows messaging or cross language communication, however.
02-24-2014 04:29 AM
Which cDAQ are you using? Most cDAQ cannot be used to run a program directly but are flexible measurement systems connected to a computer by USB or Ethernet for example.
I think that hooking up on UDP or your Mailslots can work out quite well. Accessing the Windows messaging queue is possible, but requires yourself to implement some wrappers for the Windows SDK functions for the queue..... as novice, i would not do that.
The main questions regarding Delphi (as is) and LabVIEW are:
What does the Delphi application perform and how does LV fit to that in regard to functionality?
What are the commands and data you want to pass between these two components?
What are possible performance constraints?
Norbert
02-24-2014 05:13 AM
Our general Delphi app. spread is as follows: There are more applications, TWT control for instance, but these four are the main core.
Control panel (Setting up radar parameters, recording modes, speeds, channels, transmitting frequencies, RF power, frequency switch timing etc. Calculation on recorded data. Live or off-line)
Data recording (Reads data into memory, present it for calculation and may stream it to disk.) Can be substituted by an off-line app. reading data from disk for off-line calculation.
Display (presentation of calculated results. On- and off-line. Usually runs on PC 2)
Platform control (Control of turntable/platform. Presentation of two video streams from IR and visual cameras to ensure radar is pointing at target. This runs on PC 3)
Communication goes on between just about all four apps.
cDAQ-9138 Located in RF front-end. Windows-based.. Reading of four RF power sensors. (only LabView drivers available!) Sending these parameters down for visual presentaion
and file header.
TWT amplifier cut-off in case RF power goes above a user set threshold.
Other tasks such as temperature measurements, power supply monitoring, possible ALC etc.
02-24-2014 06:27 AM
In such case, i recommend you to write a LV based program running on the cDAQ using TCP or UDP to provide data.
All other application components can subscribe to that program to receive data and work on them.
Using such approach has two major advantages:
a) You can run the application components on different PCs, e.g. if computation performance is lacking on one machine
b) It is a generic interface which is rather simple to use in different programming languages
Using Windows messaging lacks independency and might introduce additional cultrips as bustling with Windows internals can lead to ....strange situations.
Norbert