09-01-2014 03:32 PM
MikeeB wrote:
...I am struggling for space on the connector pane and having the extra input that does nothing other than pass a name through doesn't look good on the test report.
Note: you don't need an extra input on your connector pane - just an extra control on your front panel. It's a little known (and super cool) feature where the NI UTF can manipulate controls directly on your front panel, without the need to go through the VI under test's connector pane (and that's how Fab's unit tests did it in the example above).
09-01-2014 03:33 PM
btw, really enjoying this example Big thanks to Fab for setting up this group - this is fun!
09-01-2014 04:51 PM
Christopher Relf wrote:
Note: you don't need an extra input on your connector pane - just an extra control on your front panel. It's a little known (and super cool) feature where the NI UTF can manipulate controls directly on your front panel, without the need to go through the VI under test's connector pane (and that's how Fab's unit tests did it in the example above).
Actually, I did have the control connected as an optional input in the connector pane... I learned something new
Glad you are liking this group.
09-01-2014 05:30 PM
Christopher Relf wrote:
FabiolaDelaCueva wrote:
Actually, I did have the control connected as an optional input in the connector pane... I learned something new
Oh wait, maybe that's what I'm thinking of...
No, you are correct, I just tried it. I disconnected the terminal from the connector pane and ran the test again and it did work. I did not try creating it from scratch though.
09-01-2014 09:49 PM
FabiolaDelaCueva wrote:
Actually, I did have the control connected as an optional input in the connector pane... I learned something new
I just tried it. I disconnected the terminal from the connector pane and ran the test again and it did work. I did not try creating it from scratch though.
So the secret is out: if you have a front panel item (control or indicator) that's on the connector pane, the UTF will recognize it. If, at a later stage, you take it off the connector pane, UTF will continue to recognize it. The trick is that you need to put it on the connector pane for it to show up in UTF in the first place.
Although this may sound like a bug, it's actually useful for setting/reading FP items that you might normally set through loosely-typed access. The bug is that we have to put things on the connector pane in the first place
09-01-2014 10:09 PM
FabiolaDelaCueva wrote:
No, you are correct, I just tried it. I disconnected the terminal from the connector pane and ran the test again and it did work. I did not try creating it from scratch though.
Actually, after you changed the VI under Test (like disconnectting the terminal from connector pane), to keep consistent the VI and lvtest file, you need to update the lvtest file by clicking the Update button manully.
Then that terminal will disappear from lvtest file.
Besides, if you want to include controls and indicators from FP instead of connector pane, there is one configuration you can use.
Test Properties window: Advanced page -> Configuration -> Input/output values (this setting is only for this lvtest file)
"Include controls and indicators from connector pane" is its default value. You can change it to "Include controls and indicators from front panel".
If you want to make it available to the whole project, please go to Project Properties windows, then Unit Test Framework page -> Test Creation part -> Cofiguration -> Input/output values.
After you change this setting, the lvtest file created later will inherit its value.
09-02-2014 01:13 PM
Zhenfang wrote:
Actually...
Excellent post Zhenfang - thanks for the clarification and tips!