Kam

Omron NA5-7W001

22 posts in this topic

Good Morning,

I have a question about Omron's hmi NA5. In project I have vision system Cognex InSight 7800 linked via Ethernet/IP with NJ501-1320.

My question is, It is even possible to share last photo from came on Omron hmi?
 

Thanks,
Kamil.

Share this post


Link to post
Share on other sites

If the camera has a web interface there is a way to use a 3rd party web browser but you can't embed it in the screen. It is full-screen or nothing.

Share this post


Link to post
Share on other sites

I'm trying to solve this in another way, I save the photo from the camera in FTP, now I'm just looking way to read it on the HMI.
I don't know if it is possible to read it using a VB script, if I have the photo saved in FTP?

Share this post


Link to post
Share on other sites

The Omron NA5 runs an embedded version of Windows 10 from what I can see, so you should be able to load the Cognex Insight Viewer Application {VisionView}  and call it from a script.  

We did this on Panelview Plus HMI with Insight 5800, but I've never tried it in the Omron HMi World.

Share this post


Link to post
Share on other sites

@BobLfoot interesting idea, but I noticed that the  VisionView is in .exe format and must be installed, I have no idea how to install it on HMI panel.
Additionally, it takes up 500mb, unless You installed it on a Memory Card?

Because if the applications could be successfully installed, it could be called later using VB Script

Sub test
StartApplication("\User\SysmacHMI\FTP\VisionView")
End Sub

Share this post


Link to post
Share on other sites

You can call .exe files with VB. Obviously your directory and filename will be different from this web browser application but its worth a shot:

Capture.PNG

Share this post


Link to post
Share on other sites

@photovoltaic unfortunately, it probably won't work on this HMI panel.
While trying to start the application, receives this error:
"Error
VisionWiewDemo.exe.
TypeLoadException
The version of the assembly System,
Version-2.0.0.0, Culture=neutral,
PublicKeyToken=B77a5C5619334E08
9 cannot be loaded by this version of the Microsoft .NET Compact Framework."


In the Cognex manual, unfortunately Omron panels aren't in the list of items that VisionView supports.
This is not the way to do it, unfortunately.

I'm still trying to read .jpg from FTP but I haven't found a command with which to do that either, but probably on these panels it isn't possible

 

 

Edited by Kam

Share this post


Link to post
Share on other sites

I'm wondering if there is any way to refer in Root's to path of photo which is located in FTP instead of from the windows location.

sysmac.jpg

Share this post


Link to post
Share on other sites

I'm not surprised. I have tried many different applications on the NAs and almost none work. What you are thinking of doing with opening the FTP images will work. I have seen it done with VB script.

Share this post


Link to post
Share on other sites

Do you have any suggestion about the script?
I've tried a lot of different commands in VB that I knew and none worked

Share this post


Link to post
Share on other sites

I'll message you

Share this post


Link to post
Share on other sites

An update to those reading the thread - This is done with the VB command OpenMovieFile("VideoPage","MediaPlayer","/user/SysmacHMI/FTP/ImageFile.jpg")

This assumes:

Your Media Player Object has been named "MediaPlayer"

The Page it is located on is called "VideoPage"

There is a JPG file in your FTP directory called "ImageFile.jpg"

Adapt to suit your needs and call it with a nearby button.

2 people like this

Share this post


Link to post
Share on other sites

@photovoltaic it works!
I'm surprised because Movie File it theoretically opens mp4 files according to the manual.

I just have one problem, trying to somehow copy the file from FTP to the objekt and open that object via script above.
Because if I take a picture and then open it and display using the script, no more pictures get overwritten under this file name in the FTP location as long as I have that picture open on the Hmi in Media Player.
But I think that maybe it can be solved somehow by software

@photovoltaic Thank you very much for your help!

Share this post


Link to post
Share on other sites

That makes sense, it probably can't overwrite an opened file. Try issuing the command: MediaPlayer.Stop()

Programmatically I don't think you could have this automated, perhaps closing the image after a few seconds would work.

Share this post


Link to post
Share on other sites

Just a thought here...

@photovoltaic I noticed in one of your previous posts when Kam was trying to open the software (VisionView) for the camera you had a clip of code using zk_browser.
It may be possible to view the camera images live using the browser. Some of the latest firmware InSight Cognex cameras have an HMI web viewer built in. I do not know if zk browser would support the view. That would probably need tested using actual hardware. Is Internet Explorer available on the Windows CE install of the HMIs? "IExplore.exe"

Is it possible to open a program like a browser contained in something like a frame on the HMI so it doesn't go full screen?

Cognex Web HMI settings.JPG

Cognex Web HMI view selection.JPG

Cognex Web HMI view browser.JPG

Share this post


Link to post
Share on other sites

I used ZK to view a camera's web interface in the original script. It might work on the OPs camera. The downside is you lose the HMI portion while the browser is open - it essentially takes over. You also lose the on screen keyboard so for initial setup you'll need an external keyboard.

 

Edit: Also wanted to add - internet explorer is not included in the Windows CE image on the NAs. I have searched high and low for it. There are a few useful Windows applications available but no browser unfortunately.

Edited by photovoltaic

Share this post


Link to post
Share on other sites

Hi,

Instead of using Media Player you can use "Source" method for image display object. It lets you to overwrite image even if it's displayed already. Example : Image0.Source = "my image path".

Share this post


Link to post
Share on other sites
On 3/24/2023 at 5:02 AM, realisator said:

Hi,

Instead of using Media Player you can use "Source" method for image display object. It lets you to overwrite image even if it's displayed already. Example : Image0.Source = "my image path".

I tested this with no success. It will compile fine but it doesn't display anything on the image itself.

Share this post


Link to post
Share on other sites
21 hours ago, photovoltaic said:

I tested this with no success. It will compile fine but it doesn't display anything on the image itself.

I checked it too because i've never used it before and it displays the image but there's a problem with memory leakage what is common on windows CE. So it's good solution but only for one image load process.

Example of code :

Image0.Source = "/FTP/obraz10.jpg ' (it must be image path that doesn't exist to initialize)

Dim ImagePath As String = ("/FTP/" & ImageName & ".jpg" )

Image0.Source = ImagePath

So i checked another object which can display image file and DataLamp is able to do it without any problems.

DataLamp0.BackgroundImage = "" ' (initialization)
Dim ImagePath As String = ("/FTP/" & ImageName & ".jpg" )
DataLamp0.BackgroundImage = ImagePath

It may probably not work if the file size is too big. I made test on KEYENCE IV2 vision sensor which sends the file 640x480.

 

 

1 person likes this

Share this post


Link to post
Share on other sites
2 hours ago, realisator said:

I checked it too because i've never used it before and it displays the image but there's a problem with memory leakage what is common on windows CE. So it's good solution but only for one image load process.

Example of code :

Image0.Source = "/FTP/obraz10.jpg ' (it must be image path that doesn't exist to initialize)

Dim ImagePath As String = ("/FTP/" & ImageName & ".jpg" )

Image0.Source = ImagePath

So i checked another object which can display image file and DataLamp is able to do it without any problems.

DataLamp0.BackgroundImage = "" ' (initialization)
Dim ImagePath As String = ("/FTP/" & ImageName & ".jpg" )
DataLamp0.BackgroundImage = ImagePath

It may probably not work if the file size is too big. I made test on KEYENCE IV2 vision sensor which sends the file 640x480.

 

 

I see the issue. Specifying the full path doesn't work on the image display, but you need it on the media player object.

Image1.Source = "user/SysmacHMI/FTP/ImageFile.jpg"   - Doesn't work

Image1.Source = "/FTP/ImageFile.jpg"   - Works

OpenMovieFile("MediaPage", "MediaPlayer", "user/SysmacHMI/FTP/ImageFile.jpg") - Works

OpenMovieFile("MediaPage", "MediaPlayer", "/FTP/ImageFile.jpg") - Doesn't work

I opened an image that was 1863x1184 with no issue, and found I didn't need to initialize the image object. Are you saying there's a memory leak when you switch images?

 

Share this post


Link to post
Share on other sites

This works for me :

Image0.Source = "\User\SysmacHmi\inspection_" & ImageIndex & ".jpg"

or

Image0.Source = "\\Computer\Share\Inspection_4.jpg"

Thank you realisator for sharing!
 

Edited by JYG

Share this post


Link to post
Share on other sites
On 28.03.2023 at 4:50 PM, photovoltaic said:

I see the issue. Specifying the full path doesn't work on the image display, but you need it on the media player object.

Image1.Source = "user/SysmacHMI/FTP/ImageFile.jpg"   - Doesn't work

Image1.Source = "/FTP/ImageFile.jpg"   - Works

OpenMovieFile("MediaPage", "MediaPlayer", "user/SysmacHMI/FTP/ImageFile.jpg") - Works

OpenMovieFile("MediaPage", "MediaPlayer", "/FTP/ImageFile.jpg") - Doesn't work

I opened an image that was 1863x1184 with no issue, and found I didn't need to initialize the image object. Are you saying there's a memory leak when you switch images?

 

Yes there's a memory leak when updating constantly Image.Source. looks like every time new image instance is created in RAM memory so after some time You'll get out of memory Error.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now