LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wait until done

ToNi,

If you want someone to help debug a VI, as opposed to answer a question, then it's really best to attach the VI to your forum post (I see Dennis has beaten me with this request!). I also suggest that you give an explicit LabVIEW error number and exact error message when describing a problem.

By your description, either the Control Name input string isn't quite right (it is case-sensitive), or the datatype you've connected to the Value input doesn't exactly match the VI's input pane datatype. The Set Control Value [Variant] method doesn't do any coercion at all, but instead just generates an error if the input datatype differs in any way from the expected datatype. That means you'll get an error even if you do something as innocent as connecting an I32 numeric when the called VI expects a U32.

So, the solution is probably to carefully check your datatypes. If it's a cluster, make sure all component types match exactly and that the cluster order is identical, etc. The best way to ensure you don't run into a problem like this is to go to the subVI, copy the input control, and then paste it into the calling VI.

Regards,
John
0 Kudos
Message 11 of 19
(1,100 Views)
Hi,

It works but now... I have another problem. This is the following:

From my vi I call my subvi and I pass the parameters with an invoke node and I set the parameters with an invoke node (set control value [variant]).

When I press a button in my vi I call my subvi (see the block diagram 'call from vi to subvi' I post) and that's ok, my vi closes and my subvi opens. Then from my subvi, when I press another button (see the block diagram 'call from subvi to vi' I post), my subvi closes and my vi opens, that's ok. But...... when from my vi I press button again to open my subvi.... labVIEW returns me an error. It says that the vi (subvi) I want to open is in a state not compatible.

Can anyone helps me?

I post the blocks diagrams.

Thanks,

ToNi.
0 Kudos
Message 12 of 19
(1,096 Views)
Posting block diagrams as jpeg files isn't what John or I were talking about. It is much easier for someone to try and debug your code if we have actual code to debug. With jpeg files, someone has to reproduce it. I know that your will often see answers with jpeg files attached but usually (in my case anyway), that's because we often don't know the version of LabVIEW that someone is using or it's a simple way to share a solution among a lot of users.
0 Kudos
Message 13 of 19
(1,092 Views)
Sorry,

Ok,

but the problem is that you can't debug my vi because I use a conneciton with MySQL in order to retrieve data etc... you can find the images I post you in the blocks diagram:

vi -> Modificar_pla_de_treball.vi (the image 'call from vi to subvi' I posted you is in event case 'Botó modificar pla de treball : Mouse up' when you press the button 'Modificar')

subvi -> Actualitzar_pla_treball.vi (the image 'call from subvi to vi' I posted you is in event case 'botó modificar altre pla treball: Mouse up' when you press the button 'Modificar un altre pla de treball')

My problem was:

When I call subvi from my vi, the vi closes OK and my subvi opens OK when I select a item in multicolumn listbox and press button modificar. Then, from my subvi, I press the button 'Modificar un altre pla de treball' and my subvi closes and my vi opens OK but the problem is when.... from my vi... I select an item from my multicolumn listbox and I press the button 'Modificar' again.... then... LabVIEW says me the vi is not in a compatible state, because I try to open the reference of the subvi and It is already opened (I think, when I press button 'Modificar un altre pla de treball' from my subvi to return to my vi, it don't closes his reference well). How can I solve it? Why the subvi reference don't close?

Thanks,

ToNi.
0 Kudos
Message 14 of 19
(1,080 Views)
Hi again,

It crashes after the invoke method run, in the block diagram of 'Modificar_pla_de_treball.vi' when I press button 'Modificar'. The invoke method run is in the event case 'Botó modificar pla de treball : Mouse up'.

The error code is: 1000
and the description: Invoke Node in Modificar_pla_de_treball.vi

why? Is the front panel of actualitzar_pla_treball.vi still open? it doesn't close when I press button 'Modificar un altre pla treball' from my subvi?

What's the problem?


Thanks,

ToNi.
0 Kudos
Message 15 of 19
(1,077 Views)
Sorry,

Error description is:

the code is:1000
the source is: Invoke Node in Modificar_pla_de_treball.vi
and the possible reason is: LabVIEW: The VI is not in a state compatible with this operation.

ToNi.
0 Kudos
Message 16 of 19
(1,074 Views)
Hi,

I have made a little example in LV 7.0 and it works. I post my example. I use an invoke node with a run method and I pass parameters from my vi to my subVI and it works ;).

I think my problem was that my subvi depends on another vi that I call it embeding directly the vi in it without using an invoke node and... I think it is the problem. Now, I am testing it using an invoke node ... If it works I will tell you.

Since then,

Thanks,

ToNi.
0 Kudos
Message 17 of 19
(1,066 Views)
It's good that it's working, but you still might be doing this the hard way, depending on other constraints in your program. A big drawback of your technique is that it makes the code extremely hard to understand at a glance, with no apparent advantages in terms of execution properties.

Attached is an example of doing the exact same thing but maintaining the idea of a subVI call, which makes it more understandable and also allows you to use the SubVI Node Setup properties to make window control easier. This version also runs with a little less flicker than your version.

A similar technique is still possible if you don't want to load the subVI until it is called, but you would have to control its window appearance differently. I urge you to consider an alternative architecture like this that will result in simpler code for you to maintain.

--John
0 Kudos
Message 18 of 19
(1,061 Views)
Thanks Johnner for helping me 😉

It already works ;). The problem in my block diagram was that when I tried to open again my subvi, LabVIEW told me that it was in a state not compatible because the front panel was opened because of in my subvi the while loop didn't finish. Then I have put a true constant that is true when I push the button to return to my vi,and the while loop finishes and so the front panel of my subvi can close.

Thanks,

ToNi.
0 Kudos
Message 19 of 19
(1,049 Views)