From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem definining the inputs of a subvi

Dear all,

 

I am trying to configure the Keithley2182 using two subvi provided by the companies in an example. the problem is that when I parameters such as the channel and the voltage range, they do not modify the default value present in the subvi. How can I solve this problem?

 

I attach the vi and a picture indicating in which subvi I am having problems.

 

Regards

 

Download All
0 Kudos
Message 1 of 8
(1,889 Views)

Setting values of a sub VI shouldn't set the default values of the sub VI.

 

If you, for some reason, want to set default values of a sub VI, please explain why you should want that.

 

Running ahead of things, you might use an action engine for that.

Message 2 of 8
(1,886 Views)

Your VI is just a mess and contains race conditions that are probably part of the problem. For example your T1..T3 local variables will most likely get read before the terminal receives the value of the current iteration. You need to fix the dataflow and execution order.

Message 3 of 8
(1,869 Views)

Dear wiebe@CARYA,

 

Thanks for your response, I would like to impose the values from my Front Panel of the main vi, but I have seen that with this design, if I do that, then the subvi impose its default values and I do not know how to avoid this action. 

 

I will get more information about Action engines,

 

Regards

0 Kudos
Message 4 of 8
(1,794 Views)

Thank you for highlighting this additional problem, I will work on it after I find how to define the inputs of the mentioned subvi.

 

Regards

 
0 Kudos
Message 5 of 8
(1,792 Views)

@ambabiloni wrote:

Dear wiebe@CARYA,

 

Thanks for your response, I would like to impose the values from my Front Panel of the main vi, but I have seen that with this design, if I do that, then the subvi impose its default values and I do not know how to avoid this action. 


That is just how subVIs work. And for good reasons.

 

Setting values only sets them for the call you make. The next call reverts (connector pane connected) controls to their defauls.

 

If you want the main to set values, and then use them in different places, the main should manage those values. This is where the structure of the program needs to step up quite a bit.

 

Event Structure driven architectures, state machines, AF, producer consumer, and so on, are all used to make the program do what you need, in a controllable manner.

 


@ambabiloni wrote:

I will get more information about Action engines,


AE are just a means to an end. You can use them to store values in one place, and use them in another place. You can use the AE to either get the values and call the driver subVI, or make the AE call the driver subVI.

 

AE seem like the fasters way to solve this problem, but you'll soon run into other problems. You seem to want more from your program than the current "architecture" allows.

 

The result, as Altenbach mentioned, will be (is) a mess. If you want a program that lasts and grows with your demands, you should invest in learning to structure your program.

 

We can and will help, but the learning curve is a bit steep.

Message 6 of 8
(1,778 Views)

Dear wiebe@CARYA,

 

Finally, I found where is the problem. It is in the program that can be downloaded from Keithley's GitHub section.

1) There is a confusion of 0-1 and 1-2 values that always impose Channel 1.

2) Then, after selecting autorange, they always impose voltage range, so this must be corrected via a case.

 

I recommend future users to check the subvi in which these values are configured.

 

Besides, could you recommend me some book/website/youtube channel to learn structuring programs (and other basic features) to develop effective LabVIEW vis? I am learning LabVIEW by improving other's programs and I agree with you that this is not the best way to do it.

 

Regards

 

 

0 Kudos
Message 7 of 8
(1,727 Views)

Hi ambabiloni,

 


@ambabiloni wrote:

Besides, could you recommend me some … website … to learn structuring programs (and other basic features) to develop effective LabVIEW vis?


Did you notice that "Training resource" section in the header of the LabVIEW board?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 8
(1,722 Views)