Jump to content

How to I get the cases in an Event Structure


MikaelH

Recommended Posts

Hi all scripting fans

I don't like the build in Sorting feature of Event cases in the Event Structure, and though about creating an RCF-module for this.

But I can't read the Names/Cases from an event structure.

It's easy to do this if it's a Case Structure since you have the Property Node: CaseSel.FrameNames

But there is nothing like this what I can find (I might just be blind) for the Event structure.

Since there are methods (Invoke Nodes), to rearrange cases in the Event structure, there must be ways of reading the names/objects of every case.

Ideas?

Cheers,

Mikael

Link to comment

Hi all scripting fans

I don't like the build in Sorting feature of Event cases in the Event Structure, and though about creating an RCF-module for this.

But I can't read the Names/Cases from an event structure.

It's easy to do this if it's a Case Structure since you have the Property Node: CaseSel.FrameNames

But there is nothing like this what I can find (I might just be blind) for the Event structure.

Since there are methods (Invoke Nodes), to rearrange cases in the Event structure, there must be ways of reading the names/objects of every case.

Ideas?

Cheers,

Mikael

Hi Mate

I don't think its exposed. Check this post

Link to comment
  • 1 year later...

If you probe inside the OCR VI, does is extract the image (2D boolean array) for the text withing the quotation marks?

It only sort the cases based on the name of the controls, the timeout e.g. will return an empty string.

The OCR is very stupid, and I've just learned it exact how every character looks like and it does a one to one comparison.

I noticed that even if I use different fonts and sizes the font, in the Event structure it is always the same, at least on my computer.

Give me a screen shot of you event structure/font and I can compare.

Cheers,

Mike

Link to comment

I got it working in LabVIEW 8.6, but your right in 2009 it doesn't work.

The characters in the Event Structure seams to be a pixel further down, compared to my tests in 8.6.

post-941-0-28694900-1291204445_thumb.png

By updating the search algorithm this could be fixed.

Feel free to hack the code :-)

If you're wondering about the second search loop, it's because putting some characters next t each other will remove the gap between the caracters so it's hard to splt the characters up. e.g. the "kl" next to each other don't generate a gap.

Cheers,

Mike

Link to comment

Have you done anything with GOCR in LabVIEW? Do you have a sample?

Not in LabVIEW, but this is just calling an exe. So write file (PPM format), run exe, read file.

I made a quick try. For this image:

--------------

the output is

_ _1 ''Boolean'': mouse Leave _ _

For this:

---------------------------

[l]''Boolean'': mouse Leave

Probably with font definition would it would be better

[EDIT] Some problems with uploading. First image was whole the frame selector, and the second was selector with border and buttons stripped

Link to comment

Here's what I'm seeing, which doesn't look like the image Mikael posted. I can barely tell that it says "stop"; GOCR doesn't see anything. What can I do?

post-7534-0-37501400-1291372904_thumb.pn

I've attached the file as .txt instead of .ppm.

What version of LabVIEW are you using and what default fonts are you using?

Could you give me a image screen shot of your block diagram, and I can update the code to support your font.

Cheers,

Mikael

Link to comment

What version of LabVIEW are you using and what default fonts are you using?

Could you give me a image screen shot of your block diagram, and I can update the code to support your font.

Cheers,

Mikael

I'm using LabVIEW 2010 with the default fonts (I think) although, at home, my 1-bit pixmap looks like your screen shot. I think you're on to something; my fonts seem to be messed up.

post-7534-0-41685300-1291633295_thumb.pn

Edit: I see the same with versions 8.2.1, 8.6, 2009 and 2010 on my computer at work.

Edited by jcarmody
Link to comment

If you probe the Image coming out from the GetImage Invoke node, does that contain the right image?

Try 1 Bit of the Image Depth and use the Boolean 2D array out from the Unflatten Pixmap, does that work?

--Mike

The image is correct and 8-bit pixmap is the only output of Unflatten Pixmap that contains any data at all.

I've cross-posted this to NI's forum because it's left the original OCR topic.

Link to comment

The image is correct and 8-bit pixmap is the only output of Unflatten Pixmap that contains any data at all.

I've cross-posted this to NI's forum because it's left the original OCR topic.

You should be able to get 1 bit Image Depth as well, wire the constant value 1 to the Get Image Invoke node's Image Depth input.

Maybe your Unflatten Pixmap screws up the image.

//Mikael

  • Like 1
Link to comment

Here's what I'm seeing, which doesn't look like the image Mikael posted. I can barely tell that it says "stop"; GOCR doesn't see anything. What can I do?

post-7534-0-37501400-1291372904_thumb.pn

I've attached the file as .txt instead of .ppm.

I reproduced this behavior. It seems that you use ClearType font smoothing. So there are gray levels in the image. Just modify the code in such way:

post-7450-0-58048200-1291635921_thumb.pn

You can change font smoothing setting in Windows with Screen properties->Apperance tab -> Effects button -> Smoothing method->Standard (sorry, controls names may not be exact, because I translated them from localized system version).

BTW - it seems that Get Image method does not exist in 8.2 for anything but diagrams. If you want to make the code general, you should use Get Image of Block Diagram instead and trim it with Master Rectangle of structure

  • Like 2
Link to comment

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...

Important Information

By using this site, you agree to our Terms of Use.