FTP FUNCTION

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
User avatar
Ron L.
Posts: 214
Joined: Fri Jul 15, 2011 3:21 pm

Re: FTP FUNCTION

Post by Ron L. »

Once you've figured out how to create an Image control in C#, you can display it by putting it on a screen. You can get access to the screen with a cast like this in the Screen opened action. Just remember that when a screen closes that Form is destroyed.

Code: Select all

void Screen1_Opened(System.Object sender, System.EventArgs e)
		{
			Form form = (Form) this;
			
			//create new image object here
			
			form.Controls.Add(imgObj);
		}
Best Regards,

Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer

yang
Posts: 20
Joined: Wed Jan 23, 2013 9:22 am

Re: FTP FUNCTION

Post by yang »

Hello,

Several days, I tried to use

Image img=new Image(@"\storage card\vnwave.gif"). It works before. However, I got exception now. Do you know how to open image file from external folder?

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: FTP FUNCTION

Post by mark.monroe »

What is your exception? Maybe the image file as a different name?
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

yang
Posts: 20
Joined: Wed Jan 23, 2013 9:22 am

Re: FTP FUNCTION

Post by yang »

I verify it. I don't have any name problem. I got exception as below:

System.Exception:Exception

at Microsoft.AGL.Common.MISC.HandeAr(PAL_Error ar)
at System.Drawing.Bitmap._InitFromMemoryStream(MemoryStrea mstream)
at System.Drawing.Bitmap..ctor(String filename)
.....


and so on , I only copy few lines from screen.

Also, I think your iX deveoper has one issue (running on PC). When I set up T4A as main screen. I test program on PC, the simulation environment is not exactly same as T4A. For example I can open image file from PC with folder like "f:\vnwave.gif", then I have to modify it to adapt HMI folder system, like "\storage card\" or something else. but after we download the code to HMI, it doesn't work. I used other types of HMI (even beijer H-series HMI), no one simulation is like iX series. Others always are what I test on pc, what I get on HMI. Frankly, it is so difficult to test your device.

Secondly, I try to load opennetcf library located on your folder, it doesn't work it on iX developer.

Thirdly, Where the folder "project pictures" in HMI? how we address it?

User avatar
Ron L.
Posts: 214
Joined: Fri Jul 15, 2011 3:21 pm

Re: FTP FUNCTION

Post by Ron L. »

A lot of the script you are attempting will not be fully testable on the PC. The PC and the terminal have different file structures so you may have to change code to test on the PC vs. the HMI.
Secondly, I try to load opennetcf library located on your folder, it doesn't work it on iX developer.
What do you mean by doesn't work? Please send a screen shot of the error.
Thirdly, Where the folder "project pictures" in HMI? how we address it?
You may want to put this code in an event so you can exit to WinCE 6.0 and view exactly what files are on the terminal. Warning if you change something in the files, you risk corrupting the unit and will need to return it for repair.

Code: Select all

Process.Start("Explorer.exe", "");			
Application.Exit();
Best Regards,

Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer

yang
Posts: 20
Joined: Wed Jan 23, 2013 9:22 am

Re: FTP FUNCTION

Post by yang »

Hello,

I did observation a little bit. I think image has some properties not supported by HMI OS. I don't know what is that? I use your component "picture" to open the same image. It works properly. I can open image file into filestream. As soon as I create bitmap object, a error happens. So I think there is a limitation from bitmap. Do you have any idea to create image supported by windows CE? or is it possible to change picture in your component "picture" using script.

My image file is very small (about 10k), I notice bit depth 32bit and atrributes is N. Does those properties cause problem?

User avatar
Ron L.
Posts: 214
Joined: Fri Jul 15, 2011 3:21 pm

Re: FTP FUNCTION

Post by Ron L. »

I think image has some properties not supported by HMI OS. I don't know what is that?
Yes that is correct. The HMI has an underlying O.S. of Windows Embedded CE 6.0 which means it only support the ".NET Compact Framework" library which is a subset of the .NET Framework library.

If you look at MSDN documentation online, you can determine which functions are available by the mobile icons.
Snap 2013-02-05 at 15.48.48.png
Snap 2013-02-05 at 15.48.48.png (137.11 KiB) Viewed 17724 times
Another resource for the .NET Compact Framework
http://www.amazon.com/Programming-NET-C ... 0321573587
Do you have any idea to create image supported by windows CE?
I have not written the code to do this, but from the information I've gathered online this should be possible.
http://www.dotnetspider.com/resources/4 ... e-NET.aspx
or is it possible to change picture in your component "picture" using script.
We don't have any code to do this. The Multi-Picture object will let you change between different pictures at run-time, but it doesn't let you dynamically load the pictures from a file at run-time.
My image file is very small (about 10k), I notice bit depth 32bit and atrributes is N. Does those properties cause problem?
I suspect that you will have better luck dynamically loading 24-bit .BMP files from C# script into an instance of an Image control.
Best Regards,

Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer

User avatar
Ron L.
Posts: 214
Joined: Fri Jul 15, 2011 3:21 pm

Re: FTP FUNCTION

Post by Ron L. »

Yang,

Here's an example iX Developer project to get you started.
Attachments
BitmapFileTest.zip
(475.32 KiB) Downloaded 969 times
Best Regards,

Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer

Post Reply