LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the front panel and the terminals of a subVI simultaneously

Solved!
Go to solution
@Bob_Schor

I think you want to call Single with a Channel number. You configure that Channel, then what? You have two functions that I think set V and A, and one that does something else (that I don't understand). But what do you want Single to do?

The one you don't understand sets the channel (== Kanal) you are editing to ON or OFF. So you can say "I configure Channel 1, but I don't want channel 1 to be ON. Channel 2 should be ON. Channel 3 and 4 should be OFF." Then, at the end of the communication, there is a global command "Switch on the power supply!" Then the power supply switches on and enables channel 2, but leaves channel 1, 3 and 4 off.

 

NT-Single.vi should set the parameters which all channels have in common: The voltage, the current and this on/off-State. That's what I want NT-Single.vi to do. There is no need to read anything from the power supply like the set-up voltage or current. I don't need any display to what the power supply is set to. I want to ignore this and overwrite any settings of the power supply.

Christian

0 Kudos
Message 11 of 21
(2,321 Views)

I have updated the VI and started the other way round. I created the big Master-VI first. This one is working.

Now the SubVI is being called four times. Now I see no way of including the dials (spannung, strom, kanal) into the SubVI without them being removed from the front panel.

 


2018-08-30 NT-Frontpanel.png2018-08-30 NT-Blockdiagram.png

0 Kudos
Message 12 of 21
(2,302 Views)
Solution
Accepted by Exle

@Exle wrote:

I have updated the VI and started the other way round. I created the big Master-VI first. This one is working.

Now the SubVI is being called four times. Now I see no way of including the dials (spannung, strom, kanal) into the SubVI without them being removed from the front panel.

 
2018-08-30 NT-Blockdiagram.png


I Think you're confused. Apart from one improvement i'll come back to, this is how a program usually looks and should function. So no, you don't wan't that to be a sub-vi. What will happen is that you'll have a sub-vi with that White VI and those Controls as connectors, and you'll still need these Controls in the main VI to send the data, all in all you've just wrapped the White VI with a new Icon.

 

The improvement you should do, however, is to Place those Controls in a Cluster and type-def it, then use an Array of that cluster instead of 4 copies. Then you can have a for loop with the White VI and an Unbundle fed by the Array of Control cluster.

Also, remove those Reset Locals and just wire the Reset Control directly, else you'll get some strange effects later on, maybe tomorrow, maybe next week.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 13 of 21
(2,296 Views)

@Yamaeda wrote:

@Exle

Also, remove those Reset Locals and just wire the Reset Control directly, else you'll get some strange effects later on, maybe tomorrow, maybe next week.


Reading from a terminal and immediately writing to a local variable of that same terminal tells us that you have no understanding of local variables. This is a NOOP!

 

resetrace.png

 

None of these local are needed, just wire it all together.

 

(This VI has terminals assigned, it seems like it is a subVI called from elsewhere. The reset has no terminal assigned, though. Still seems half-baked. :D)

 

 

0 Kudos
Message 14 of 21
(2,281 Views)

@Yamaeda Thank you for the hint to type-def the three controls. I didn't know that I could do this, it goes into the direction of "re-using the front panel" I had with my posting in mind.

kind regards,
Christian

2018-08-31 NT-Frontpanel.png

Message 15 of 21
(2,273 Views)

You seems to use a strange build function, just use the normal Build Array and you won't need the 1st unbundle function.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 16 of 21
(2,255 Views)

@Yamaeda wrote:

You seems to use a strange build function, just use the normal Build Array and you won't need the 1st unbundle function.

/Y


I would actually go one step further and place an array of such controls directly on the front panel (looks and functions the same).

 

Note that you should not wire N of the FOR loop when auto-indexing unless you want to iterate fewer times as the array size of the auto-indexing array. You might also want to use shift registers for the error and  VISA resource to pass the output even if the loop iterates zero times (not shown).

 

Array_it.png

 

(NOTE: this requires that all cluster elements have the same scale ranges for each control, which seems to be the case here. Make sure to make an array with 4 elements the default for the array so it does not come up grey the next time you open the VI) 

 

 

Message 17 of 21
(2,248 Views)

@altenbach

I would actually go one step further and place an array of such controls directly on the front panel (looks and functions the same).

I did this and it actually solved another problem I had: I wanted to call this VI from TestStand. At the moment I had to wire 12+ wires to the connection terminals. Now, with the array, I only have to wire the array and arrange the settings in TestStand.

kind regards, Christian

0 Kudos
Message 18 of 21
(2,233 Views)

@altenbach wrote:

@Yamaeda wrote:

You seems to use a strange build function, just use the normal Build Array and you won't need the 1st unbundle function.

/Y


I would actually go one step further and place an array of such controls directly on the front panel (looks and functions the same).

 

Note that you should not wire N of the FOR loop when auto-indexing unless you want to iterate fewer times as the array size of the auto-indexing array. You might also want to use shift registers for the error and  VISA resource to pass the output even if the loop iterates zero times (not shown).

 

Array_it.png

 

(NOTE: this requires that all cluster elements have the same scale ranges for each control, which seems to be the case here. Make sure to make an array with 4 elements the default for the array so it does not come up grey the next time you open the VI) 

 

 


That's actually what i wrote in my first post, but if you forget to "Set values as default" or initialize that Array it can cause some issues that you won't have with 4 clusters, so i thought i'd let it slip. 🙂  
As OP says it solved Another problem, making it an Array, so that's good. (I have no idea why the autocorrect adds random big letters, but i can't be arsed to go back and change it this time)

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 19 of 21
(2,221 Views)

@Yamaeda wrote:

@altenbachThat's actually what i wrote in my first post, but if you forget to "Set values as default" or initialize that Array it can cause some issues that you won't have with 4 clusters, so i thought i'd let it slip. 🙂  

Us graphical programmers are not good with words, so unless I see it on an image, i miss things (still cannot find it ;))

Yes, I mentioned to make the four-element array the default..

Message 20 of 21
(2,217 Views)