Picture show in ListBox from HMI ftp

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
JohnCZ
Posts: 73
Joined: Wed Jun 27, 2012 1:17 am
Location: CZ
Contact:

Picture show in ListBox from HMI ftp

Post by JohnCZ »

Hello everyone,
Deals with one specific application. I have a 5 camera Cognex In-Sight and 5xHMI T15B. Driver on Cognex works great. Now cameras stores images in a ftp HMI. Now I need to be able to select an image and display it on HMI.

My idea was that i choose a picture from ListBox. Click on Button and the picture
which I have chosen appear to me in PictureBox.

Problem is That I Can not Fill the list box with the names of the current images stored in Project Files and then to show in PictureBox

I try>

Code: Select all

	

DirectoryInfo dinfo = new DirectoryInfo(@"\FlashDrive\Project\Project Files")
			FileInfo[] Files = dinfo.GetFiles("*.jpg");
			foreach( FileInfo file in Files )
			{
				ListBox2.Items.Add(file.Name);	
			}
Do you have any ide how to do it ??
JohnCZ

JohnCZ
Posts: 73
Joined: Wed Jun 27, 2012 1:17 am
Location: CZ
Contact:

Re: Picture show in ListBox from HMI ftp

Post by JohnCZ »

Hi again

Well news: Now it's work on PC platform and (T21C). When I click on Listbox it will show me picture from file in Windows. But this is not working on panel. It's show me an error message that I can not used PictureBox1.?mage ????

Works on PC
PC version
PC version
picture1.jpg (88.14 KiB) Viewed 9225 times
When I try to build to T15B
T15B version
T15B version
picture2.jpg (86.45 KiB) Viewed 9225 times
Have anyone Idea how to do on panel ???
JohnCZ
Attachments
Project1.zip
(71.89 KiB) Downloaded 762 times

JohnCZ
Posts: 73
Joined: Wed Jun 27, 2012 1:17 am
Location: CZ
Contact:

Re: Picture show in ListBox from HMI ftp

Post by JohnCZ »

Hello all,

we have succeed with showing picture from Cognex throught FTP connection. We have go by two ways:

Firstst way is:
T7A shows every 1000 ms image from FTP ( Project file folder ). This Image is stored from cognex camera (every 100ms) to FTP on Beijer T7A. We could shows images from FTP faster then 1000ms, but TxA is not so fast as TxB.


Second way is:
We ( because we have driver on Cognex In-Sight) or Cognex camera has triggered and capture image to FTP and we only shows this images from ListBox to picturebox. We could then stored to folder ( USB or SD ) with name of current day and then we could find it in future like history function pictures from date xxx..

Third way is to have from Cognex software ( Cognex Beijer Vision Viewer CE) but this is Licence solution and it's not cheap.


BR
JohnCZ

Post Reply