Jump to content

Read the Frame names of a case structure


Recommended Posts

QUOTE(Tomi Maila @ Feb 11 2008, 05:47 AM)

It would be helpful if you described how the code doesn't work.

p.s. Don't forget to close the block diagram reference.

OK here you go...

this piece works very well when i just a have a vi with a case structure with only 2 frame names (True and false) . When i put it in to the application which i have developed (which is having more than 100 states in a state machine) it does not work. It throws the error as "Invalid object reference" or someything similar to that

Link to comment

QUOTE(guruthilak@yahoo.com @ Feb 11 2008, 12:32 PM)

this piece works very well when i just a have a vi with a case structure with only 2 frame names (True and false) . When i put it in to the application which i have developed (which is having more than 100 states in a state machine) it does not work. It throws the error as "Invalid object reference" or someything similar to that

I haven't found any problem, but didn't try so many cases.

The error is thrown in the "Open VI Object Reference" node, isn't it? Is it possible the frames are located inside another structure, and so the fuction can't find them?

Saludos,

Aitor

Link to comment

QUOTE(guruthilak@yahoo.com @ Feb 11 2008, 05:32 AM)

When i put it in to the application which i have developed

Are you actually building this into an EXE or DLL? If so, the problem would be that VIs don't have block diagrams in a built application. The runtime engine doesn't support any of the functions for inspecting the diagram. You would definitely get an "invalid object reference" in that case.

Link to comment

QUOTE(Aristos Queue @ Feb 11 2008, 05:25 PM)

Are you actually building this into an EXE or DLL? If so, the problem would be that VIs don't have block diagrams in a built application. The runtime engine doesn't support any of the functions for inspecting the diagram. You would definitely get an "invalid object reference" in that case.

I AM not using this in in a exe or dll. The only thing is that this case struture is within a "while loop". and only in this application it throwing the errror.. When i try it with a new simplae vi it works fine.

Link to comment

QUOTE(guruthilak@yahoo.com @ Feb 12 2008, 07:24 AM)

I AM not using this in in a exe or dll. The only thing is that this case struture is within a "while loop". and only in this application it throwing the errror.. When i try it with a new simplae vi it works fine.

OK that makes sense,

you should navigate your way to the case structure, so first open a reference to the 'while loop' and then open a reference to the structure within.

Ton

Link to comment
  • 11 months later...

QUOTE (wishfulthings @ Feb 12 2009, 06:18 AM)

This is exactly what I want to do but I'm using 8.6 and can't seem to get access to the Block Diagram property node. Is there a similar method I can use for 8.6.

This is my first post and I only have a few months Labview experience so hopefully this isn't a stupid question :)

Could you please explain what you are trying to accomplish?

A first LV project should not require advanced technique like Scripting. Maybe we can offer a simpler approach.

Ben

Link to comment

QUOTE (crelf @ Feb 24 2009, 04:00 PM)

I have attached a number of VIs and will attempt to explain their operation. Download File:post-14706-1235987484.vi

Download File:post-14706-1235988461.vi

Download File:post-14706-1235988471.vi

I have been tasked with trying to make a sequencer using a state machine with perhaps 100s of cases. I decided it would be nice to split the cases into groupings which were more logical, ie all cases relating to GPIB instruments together in a seperate VI, cases for switching in another vi etc... In doing this my difficulty was to then know in which vi a case resided. This was necessary as to open each vi sequentially and then look for a case was causing unacceptable delays when running the application. So I needed to create a look up so I would know exactly where to find each case. This was how I did it but there may be a much cleaner way.

Firstly the "Read Case Names.vi" reads all the cases in the vis located in a test sequences subdirectory up from my working directory and writes them to a cases.txt file.

Then the "Write Case Locations.vi" writes the cases and their locations to two seperate arrays.

These have been incorporated into a "Create Control.vi" which then creates a control for all the cases which enables me to use the cases as strict typedef enum which I can use to then select my next state(s) in the state machine.

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
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.