02-23-2018 07:12 AM
Please see the attached snippet(s).
This code works fine in the loop as show. However, if I convert it to a sub-vi (with controls and indicators exterior to the sub as usual), the code doesn't work. I am initializing as in the attached expansion.
Can't seem to figure out why?
Idears?
Thanks all,
Chris
Solved! Go to Solution.
02-23-2018 07:22 AM
Stop gets read when you call the subVI and never again. You have the opposite problem you think you have. It does function... forever.
02-23-2018 07:23 AM - edited 02-23-2018 07:25 AM
Hi bonnerup,
call those two case structure sequential instead of parallel. They use a shared resource!
You should also replace those "x/=y" functions by BooleanCrossing for boolean signals (or just an XOR)…
Using AutoCleanup would be nice, too.
Edit: Are talking about the "code in the loop" or "whole code as shown in the snippet"?
02-23-2018 10:09 AM
Thanks,
Edit: Are talking about the "code in the loop" or "whole code as shown in the snippet"?
What I was trying to refer to was the code in the sub, when placed as a sub-vi in a while loop, doesn't work. The expanded code shown in the while loop does perform as expected.
Yea, know it's nasty, but it IS a construction zone at the moment.
Chris
02-23-2018 11:46 AM
Please show us the diagram of the created subVI and the diagram of the caller. Even better, attach your VIs (before & after, all zipped up)
02-24-2018 12:16 PM
Thanks for helping.
Attached are two vi's and the lvlib of the Agilent subs.
Same code in both except one is reduced to a sub - it does not work; other does.
The parallelism is due to asynchronous calls to each channel.
Really appreciate your help. Sure I'm doing something obvious, but just can't see it %>(
Chris
02-24-2018 12:34 PM
You did not attach the created subVI.
02-24-2018 12:40 PM
My apologies.
Attached
02-24-2018 01:16 PM
Thanks. Your lvlib is also just an empty shell, there is no code (drivers) in it at all. Is there web site with the help?
Have you tried running the two case structures in sequence instead of branching the wire as has been suggested?
02-24-2018 01:31 PM
Attached are the Agilent E363x drivers directly from the NI website of third-party drivers. I hope this helps.