LAVA 1.0 Content Posted February 12, 2008 Report Share Posted February 12, 2008 Why this piece of code does not work everytime? Anu suggestuons availabe? Quote Link to comment
Tomi Maila Posted February 12, 2008 Report Share Posted February 12, 2008 QUOTE(guruthilak@yahoo.com @ Feb 11 2008, 12:18 PM) Why this piece of code does not work everytime? Anu suggestuons availabe? It would be helpful if you described how the code doesn't work. p.s. Don't forget to close the block diagram reference. Quote Link to comment
LAVA 1.0 Content Posted February 12, 2008 Author Report Share Posted February 12, 2008 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 Quote Link to comment
Aitor Solar Posted February 12, 2008 Report Share Posted February 12, 2008 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 Quote Link to comment
Norm Kirchner Posted February 12, 2008 Report Share Posted February 12, 2008 Have you thought that you possibly have 2 structures named the same thing? Have you tried re-naming it to something simple and trying again? Quote Link to comment
Aristos Queue Posted February 12, 2008 Report Share Posted February 12, 2008 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. Quote Link to comment
LAVA 1.0 Content Posted February 13, 2008 Author Report Share Posted February 13, 2008 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. Quote Link to comment
Ton Plomp Posted February 13, 2008 Report Share Posted February 13, 2008 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 Quote Link to comment
Norm Kirchner Posted February 15, 2008 Report Share Posted February 15, 2008 Actually you should probably just use the TraverseforRef vi and then simply do a named filter. It will provide much more robust results as you don't have to care about who is the immidiate parent of the case structure. Quote Link to comment
wishfulthings Posted February 13, 2009 Report Share Posted February 13, 2009 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 Quote Link to comment
crelf Posted February 18, 2009 Report Share Posted February 18, 2009 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 That's not a stupid question at all (I actually did the same thing yesterday), but you may not like the answer: there is a way to get the block diagram property node, but it's a private method - http://forums.lavag.org/VI-Scripting-Readme-First-t1207.html' target="_blank">read here for more information on how to get access to private methods. Quote Link to comment
Grampa_of_Oliva_n_Eden Posted February 18, 2009 Report Share Posted February 18, 2009 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 Quote Link to comment
wishfulthings Posted February 25, 2009 Report Share Posted February 25, 2009 QUOTE (crelf @ Feb 17 2009, 04:07 PM) That's not a stupid question at all (I actually did the same thing yesterday), but you may not like the answer: there is a way to get the block diagram property node, but it's a private method - http://forums.lavag.org/VI-Scripting-Readme-First-t1207.html' target="_blank">read here for more information on how to get access to private methods. Thanks for the info. I've now got it working perfectly Quote Link to comment
crelf Posted February 25, 2009 Report Share Posted February 25, 2009 QUOTE (wishfulthings @ Feb 24 2009, 05:57 AM) Thanks for the info. I've now got it working perfectly No worries. Care to upload what you did so we can take a loo? Quote Link to comment
wishfulthings Posted March 3, 2009 Report Share Posted March 3, 2009 QUOTE (crelf @ Feb 24 2009, 04:00 PM) No worries. Care to upload what you did so we can take a loo? 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. Quote Link to comment
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.