LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the easiest way to open an application from Labview?

I need to open an application from labview and depending on a user's selection, load one out of a group of files for the application that is opened. I need to know what is the best or easiest way to open an application and load a file that is used by the application based on a selection.
0 Kudos
Message 1 of 8
(4,677 Views)
It depends on the application. If it's an app with an ActiveX interface like Word, or Excel, then you would use the properties and methods of the app to do what you want. Explain what type of automation interface that the vendor f the app provides.
0 Kudos
Message 2 of 8
(4,673 Views)
The application is In-sight by Cognex. It is a vision program that uses .job files. The .job files let the software (In-sight) know how to configure the camera for a specific product that one wishes to measure using the camera.
0 Kudos
Message 3 of 8
(4,667 Views)
I have no experience with that program but there have been a few posts about it. Search the forums for 'Cognex'. There may be some forum members with experience and may see this thread but you should contact Cognex about their software. Whatever exists for automation is going to be unique to them and you will need their documentation. LabVIEW has some of the low level tools such as what is on the Connectivity>ActiveX palette but you can't do much without information from Cognex.
0 Kudos
Message 4 of 8
(4,660 Views)

Here is the response that I got from Cognex when I asked them about how to do this. Do you understand what they are talking about?

 

 

In order to do something like this you will probably want to look into the Display Control/SDK for In-Sight. The Display Control gets installed along with In-Sight Explorer and includes a control that can be used in an environment like Labview to communicate with In-Sight sensors while the SDK is an enhanced version of the Display Control that gives you more control and functionality. I am not very familiar with the Labview environment so I will give some code snippets in VB.Net and hopefully you can adjust them as necessary. Specifically I see 3 possible avenues to do this:

 

1) Using the Display Control you have access to many of the dialog boxes that are used in In-Sight Explorer including the Load Job dialog box. You can spawn this dialog box through a line of code similar to cvsInSightDisplay1.Edit.OpenJob.Execute(). I am not certain if the Labview environment will be able to spawn and display this dialog though.

2) With the addition of the SDK (additional purchase) you can directly access sensor properties including the job. There is a method called LoadJobFile to load jobs from on the sensor and LoadJobFileLocally to load jobs from the host machine. A typical line of code might be cvsInSightDisplay1.InSight.File.LoadJobFile("myjob1.job").3)

If Labview cannot handle the dialogs and the SDK is not an option for you then you may still be able to do this using Native Mode commands. Native Mode commands are sent through a socket on the telnet port (typically port 23). Keep in mind that you will need to handle the username/password prompt and response when you first open the socket before issuing any Native Mode commands. The command to load a job file from the sensor would be the Load File command which would be a string similar to "LF myjob1.job". The Native Mode commands are documented in the In-Sight Explorer help file.

 

0 Kudos
Message 5 of 8
(4,633 Views)

I'm not quite sure if they are using .NET or ActiveX but you can use either in LabVIEW. There are example VIs for both. Telnet is also supported in LabVIEW with the Internet Toolkit.

0 Kudos
Message 6 of 8
(4,627 Views)

If you have the internet toolkit for labview, option 3 is quite simple, and to answer your question, I understand it. 🙂

 

The real question is do you understand it? 😉

 

If you have the internet toolkit installed, I can probably walk you through setting up a connection to that socket, though I have a feeling several other people will also jump on it. 

0 Kudos
Message 7 of 8
(4,615 Views)
I can now open the In-Sight Explorer from within Labview using the Sys exec. I'm not doing any good opening the .job files that are used by In-sight Explorer without getting an error. If I try to open the .job files without relying on Labview, they still will not open without opening In-sight first. To open a .job file, I must first open In-sight and then open the .job file. The .job file is located in a menu drop down and the user has the option of opening .job file by clicking on open .job file or using the hot keys ctrl O.




0 Kudos
Message 8 of 8
(4,535 Views)