From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

Cannot call subVI without errors-- but fine as standard VI

Hello all,

I have a VI that works perfectly fine when run independently of anything else, but when called from another VI (which I rather need to do) it chokes, and I get a VISA command error (as in, it returns an error saying there's a problem with the command sent to the program).  To be perfectly clear, it's getting the _exact_ same input manually and via the super-VI. 

I'm a little confused both as to how this is possible and what to do about it.  I've tried clearing the VISA buffers in question before calling this VI, to no avail, and am not sure I can close and reopen without causing other problems.  Does anyone have any ideas?

0 Kudos
Message 1 of 10
(2,556 Views)

Let's see some code.  Otherwise it is a complete shot in the dark.


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 2 of 10
(2,553 Views)

Gladly.  Should I attach the code as files, or should I screenshot?

0 Kudos
Message 3 of 10
(2,548 Views)

We recommend posting the VIs.  If you have more than one (sounds like you should) then zip up the files and post the zip file.


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 4 of 10
(2,540 Views)

If its simple inline snippets.  these let everyone see what you've got and we can dig into the code with a few drags n drops.   otherwise attach .vi's or a zip of the whole project.


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 10
(2,537 Views)

This has some irrelevant files buried further in the .zip.  The two most relevant are in the first level (e.g. immediately on unzipping)-- I can run 'setpoint' on its own, but if I try to run 'readout_combined', setpoint is where it breaks.

0 Kudos
Message 6 of 10
(2,531 Views)

I have no Idea why you would send a selected device clear.  This would be a problem the Lakshore resets when you raise DC1


"Should be" isn't "Is" -Jay
Message 7 of 10
(2,518 Views)

I'm sorry, I don't understand what you mean.  What's DC1?

EDIT: Based on your suggestion, I deleted the clear block (which made sense as I chased down an earlier error), and suddenly it works perfectly.  Still don't understand why though.

0 Kudos
Message 8 of 10
(2,510 Views)

For GPIB devices CLR send s "Selected Device Clear"  Which, in this case, is also a reset command for the device (you can tell from the utility device reset)

 

DC1 is one of the handshake lines on the GPIB bus it is  not too surprising that it is involved with Device Clear commands.


"Should be" isn't "Is" -Jay
Message 9 of 10
(2,501 Views)

I did not know that.  No wonder it was causing problems!

Thank you!

0 Kudos
Message 10 of 10
(2,491 Views)