LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DDE control of Labview front panel controls

I am new to Labview and am attempting to create a front panel to control a signal generator but  I would like to pass

values to the controls on my front panel from another application software that  I am writing.

 

The vi that I created works fine for controlling the generator in a manual mode but I need to know how to send commands to the front panel

to load strings and to click a button.

 

The typical Wondows applications that I am used to have a dialog box with an ID and containing controls with specific ID's

that I can get a handle to but the Labview VI seems to be one embedded block that I can not determine the individual control

handles for.

 

Is there a way to determine these windows ID handles or is this not possible in Labview... or is there a better way to do this?

 

thanks

0 Kudos
Message 1 of 17
(4,032 Views)

Use ActiveX to get at the LV obljects?

 

I never tried to do it backwards.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 17
(4,029 Views)

There is no way to get the Dialog ID of a LabVIEW control, since they are not Windows windows at all. Typically all standard Windows controls are in fact windows and therefore can be treated as such, sending Windows messages to them etc. This is in most cases a rather bad way of controlling an application, because it is bound to break often with new version updates, that might change the dialog IDs, names or message behaviour of specific controls. LabVIEW being a multiplatform application and in fact originating from the Macintosh could not use Windows windows to implement it's controls. Also seeing that only a small part of the LabVIEW controls is in fact similar to Windows controls (ever seen a common dialog graph, dial, or gauge? Smiley Very Happy ), it would not work easily anyhow.

 

So LabVIEW only uses Windows windows for the front panel and diagram windows and implements its own widget library completely independent on the actual platform that it is build for.

 

As Ben has already told you, LabVIEW does provide an ActiveX Automation interface, although you may have to enable it in the Option settings. With that you can use ActiveX to open a connection to the LabVIEW application, open a reference to a specific VI and then get and set the values of controls based on the label of those controls.

 

Look for the VBToLV example in "examples/comm" in your LabVIEW folder for a Visual Basic example of how to do that.

Message Edited by rolfk on 05-20-2010 07:59 PM
Rolf Kalbermatter
My Blog
Message 3 of 17
(4,015 Views)

Um...  Guys I think the OP is asking about how to wire a connector pane. 

 

From the help file look at Building the Connector Pane 

Building the Connector Pane

To use a VI as a subVI, you need to build a connector pane, shown as follows.

The connector pane is a set of terminals that corresponds to the controls and indicators of that VI, similar to the parameter list of a function call in text-based programming languages. The connector pane defines the inputs and outputs you can wire to the VI so you can use it as a subVI. A connector pane receives data at its input terminals and passes the data to the block diagram code through the front panel controls and receives the results at its output terminals from the front panel indicators.

Define connections by assigning a front panel control or indicator to each of the connector pane terminals. To define a connector pane, right-click the icon in the upper right corner of the front panel and select Show Connector from the shortcut menu to display the connector pane. The connector pane appears in place of the icon. When you view the connector pane for the first time, you see a connector pattern. You can select a different pattern by right-clicking the connector pane and selecting Patterns from the shortcut menu.


 

Message Edited by Jeff Bohrer on 05-20-2010 01:07 PM

"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 17
(4,007 Views)

Jeff Bohrer wrote:

Um...  Guys I think the OP is asking about how to wire a connector pane. 

 

...


Well even if we read the OP wrong we still got a tag-able reply out of Rolf. Smiley Wink

 

Thank you Rolf!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 17
(4,003 Views)

Jeff Bohrer wrote:

Um...  Guys I think the OP is asking about how to wire a connector pane. 


 

It might be debatable as this: 

 


 

I am new to Labview and am attempting to create a front panel to control a signal generator but  I would like to pass values to the controls on my front panel from another application software that  I am writing.


 
and the DDE in the topic title really hint into an interapplication communication problem.

But maybe you are right and I'm just searching way to far into the technical details. Smiley Very Happy
Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 17
(3,989 Views)

Jeff Bohrer wrote:

Um...  Guys I think the OP is asking about how to wire a connector pane. 


Are you sure you're reading the same message I'm reading? 'Cause I certainly don't see how the question has anything to do with connector panes, especially with a topic of "DDE control of LabVIEW front panel controls", and "pass values to the controls on my front panel from another application software that  I am writing" and "how to send commands to the front panel to load strings and to click a button".

 

0 Kudos
Message 7 of 17
(3,984 Views)

thanks for the dialog guys, but maybe I am not explaining myself very well...

 

Here is what I am trying to do:

 

I have a Rigol signal generator that I need to pass commands to but there isn't any virtual port USB drivers out there that will allow me to write commands to it as if it were a USB device. It does show up in my device manager as a USB measurement device but because there isn't a virtual com port available, it does not show up as a com port.

 

I was able to write a VI that allows me to control this device but when I compile the project I notice that there is no way to get at the controls on my front panel which might be another way that I can get the commands to this device.

 

I was hoping to find a way that would allow me to pass commands to the VI (on the same PC) from another software script (not labview) to ultimately control this device.

 

I know that this may seem like an obscene work around but I am only looking for a way to pass commands to this signal generator because the manufacturer does not offer any assistance in this area and I did have some success in controlling this device from Labview.

 

Preferably, I would like to have a driver which allows me to access this signal generator as a com port and then I coupld simply pass it commands with out hte labview work around.

 

Is there a better or easier way out there to control this device remotely?

 

thaks for your help with this request!

0 Kudos
Message 8 of 17
(3,955 Views)

As has already been mentioned, ActiveX can be used to control a LabVIEW app from another application.

 


Japper wrote: 

I was able to write a VI that allows me to control this device but when I compile the project I notice that there is no way to get at the controls on my front panel which might be another way that I can get the commands to this device.


The obvious question I have is: what did you use in LabVIEW? Did you use VISA? If so, VISA can be used from other applications as well. Did you use something else? 

 

0 Kudos
Message 9 of 17
(3,943 Views)

[quote]

As has already been mentioned, ActiveX can be used to control a LabVIEW app from another application.


Japper wrote: 

I was able to write a VI that allows me to control this device but when I compile the project I notice that there is no way to get at the controls on my front panel which might be another way that I can get the commands to this device.


The obvious question I have is: what did you use in LabVIEW? Did you use VISA? If so, VISA can be used from other applications as well. Did you use something else? 

[/quote]

 

I will have to search for a link on "activeX and how to control a Labview app..." hopefully there are some good tutorials out there.

 

I did use a VISA but not sure how to control this from another app. maybe some of these "buzz words" that are new to me will allow me to find links to some useful information that I can learn more.

 

thanks for the tips

 

0 Kudos
Message 10 of 17
(3,925 Views)