Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Communication SubVI

Solved!
Go to solution

Hello all,

 

I am new to this forum and LabVIEW in general. I have been playing with it for a couple weeks and have managed to make some simple applications for some of my devices. Now has come the time for me to make a larger VI so I am in need of figuring out how to make a subVI. I know you have to highlight what you need and then make it a subVI but I am having trouble figuring something out. I have some connectors which take in a VISA resource name and output it and the error in and out. When I select it though and make it a subVI the wiring  disappears. I would like the purple and yellow wires to be able to be connected to in the subVI because if I cannot then the program will be broken. It is meant to be a general Vi which will be reused. I have attached it so you can see the VI I am working with. As you can see in the PNG it has the output double but I also need the input/output resource name to show along with the error. Can anyone help me out?

 

Thank you.

Download All
0 Kudos
Message 1 of 6
(2,524 Views)

You didn't really supply any context with your posted VI.  It would possibly help if you supplied the subVI as well.  But if I am understanding correctly, I think you just need to not select the VISA Resource and Error terminals when you "create a subVI".


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 6
(2,455 Views)

Im not sure what context I need but I just need to send a command for my temperature controller to read the current temperature. I communicate with it using serial communication. I am trying to make a subVI that reads for me and that can be hooked up to the other serial functions such as open and close. For this I need to make the attached subVI have the purple and yellow wires but currently mine does not and I cannot just unselect them as they are in the sequence structure. i have attached the subVI. 

 

Thank you for your reply and help I really appreciate it. 

0 Kudos
Message 3 of 6
(2,429 Views)
Solution
Accepted by topic author e.chavez

Well, nothing says you can't just manually add the parts and connect them up to the connector pane.  Here is a much cleaned up version of your code (remove the Bytes At Port, remove sequence structure as data flow will take care of it, added the terminals, simplified the reading of the value, changed your case structure into an array with an Index Array to acts as a simple lookup table).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Download All
Message 4 of 6
(2,420 Views)

Thank you! That is exactly what I was looking for. May I ask how you added the Visa and error in and the visa and error out like that? I'm still not all to familiar with LabVIEW.

0 Kudos
Message 5 of 6
(2,415 Views)

They are in the palettes.  Or you can right-click on the connector panes of the functions and choose to create control/indicator/constant.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 6
(2,408 Views)