Jump to content
OMRON Forums

ACE Automation Control Environment- Hexsight Option- GrabImage


JoergVogel

Recommended Posts

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 by JoergVogel
Add main line of source code to text, because download of attachment is not free
Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...