JoergVogel Posted December 3, 2022 Posted December 3, 2022 (edited) A custom camera device is a script, that anyone can add by New menu option into the Explorer tree in ACE. There is a hint to import an image file. Our goal was to acquire images from cheaper camera devices, that are capable to work 24/7. Surveillance Cameras are a solution for this condition. Most of them can transfer images to an FTP Server. And the Custom Device in ACE can read those image files. Because of the huge amount of file transfers the storage capacity ends after some month. Maybe the hardware can be damaged too by many writing jobs. You can get around this by using a software ramdisk program and a routine to delete older files instantly. I attach our script file which reads any newest image of a ramdisk directory for a demonstration. Please feel free to comment or answer any suggestions of improvement. EDIT main source code: using System.io; string[] Picfiles = Directory.GetFiles(@"O:\", "B*.bmp", SearchOption.AllDirectories);// drive letter “O”, //get an array of paths of bitmap files string picFile = Picfiles[Picfiles.Length-1]; // last completely transferred file if (Picfiles.Length < 1) { picFile = @"C:\Daten\08-Labor\default.bmp";} // default image, if nothing is transferred int bitsPerPixel = IsColor ? 32 : 8; // default custom code int lLength = ImageSize.Width * ImageSize.Height * (bitsPerPixel / 8); // default custom code return CSharpDevice.ConvertImageFile(picFile, IsColor == false);// hint custom code Thanks! Regards Joerg. CSharp_Camera Custom Device Read Picture Files from RamDisk.txt Edited December 5, 2022 by JoergVogel Add main line of source code to text, because download of attachment is not free Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.