View windows Application in an Ignition Window

Hello All,

I’m trying to find out if there is a way to view an application that is running in the background on the same windows pc as the client. I’ve figured out how to launch external applications but what i want to do is open some sort of a shell from an ignition window to look at that application thats already running in the background.

Thanks !

Ignition 7.9.7

Can you be a little more specific as to what you’re trying to accomplish?

Are you trying to somehow render another application’s window inside Ignition?

Are you just trying to view some status about another running process?

so basically I have a cognex camera set up inside the machine. I’m trying to get a live view of the inspection through their software VisionView. The software is installed on the client pc and is on the same network as the camera. Is there a way to show a rendering of VisionView in Ignition?

I’m not at all familiar with Cognex or VisionView. Can you get an mjpeg stream directly from the camera’s IP (assuming it has one) or from VisionView?

If so, you can render it in Ignition’s IP Camera Viewer Component.

unfortunately you can’t get an mjpeg. The way VisionView connects to the camera is by using FTP.

I assume it receives still images over FTP?

You could try grabbing the files in Ignition and coming up with some way to only render the most recent image.

There’s likely a better way though. I’d check the camera’s documentation to see if it exposes an MJPEG or RTSP stream.

JPEG or MJPEG. RTSP is not supported by the IP Camera Viewer Component.

1 Like

What if i store images using ftp to a folder in my C drive and then have an image component that has a dynamic file path to somehow always show the most recent image in that file path. is that easy to implement and what kind of script would be required to continuously check for new images in that file path ?

That might work. You could put something like this in a gateway timer event script at a rate of every second or so:

import glob
import os

list_of_files = glob.glob('/path/to/folder/*')  # get a list of all files in the folder
latest_file = max(list_of_files, key=os.path.getctime) # filter for only the most recently created file
system.tag.write('latestCameraImagePath', latest_file)

Now you have the path to the latest image in the gateway, but you need to get the actual image bytes to the clients. You could either give them access to read the file directly from the gateway (wouldn’t recommend), or have the gateway read in the image bytes and store them in a tag. For the latter approach, you could setup a ValueChange event script on the path tag that populates a byte array tag:

bytes = system.file.readFileAsBytes(currentValue.value)
system.tag.write(latestCameraImageBytes, bytes)

The last step would be to render those bytes in your client window. For that you could attach the following script to a Timer Component on the vision window:

from javax.swing import ImageIcon

imageComponent = event.source.parent.getComponent("Image")
bytes = system.tag.read(latestCameraImageBytes).value
icon = ImageIcon(bytes)
imageComponent.setIcon(icon)
3 Likes

Perfect! Thanks alot