07-09-2019 04:17 AM
Hi,
I'm trying to build a program where I can choose different kinds of sensors connected to the same module.
At this point, I can get readings from 4 channels and log the output.
My problem is, that when I select "No sensor" connected, my array skips the port, and mess my program up because of no output from the case structure.
Is there some way to lock the array to the specific port or move a zero into the array? So even when there is no sensor connected to ex. channel 1, channel 2 still gets the readings from sensor 2.
Best regards
07-10-2019 06:26 AM
Hello M.,
First some general advice: Apply the benefits of modularity. Use subVIs! If I am not mistaken, you have the exact same, huge case structure in your code four times. If you need to change something, you'll need to change it four times to not introduce a bug. Tricky...
Regarding your question, I normally use an approach like this, in the order of execution:
07-10-2019 06:53 AM
Hi Ikaiser,
Thanks a lot for your answer and your advice. This is my first program, so I am still learning. But I can see it would help me a lot if I just make SubVIs.
Is it possible to see an example of your approach? Sounds very similar to what I am trying to make. 🙂
best regards.