03-05-2013 07:53 PM
I'm trying to clean up some code and I'm looking for style advice. The following code actually works as desired, but I'm wondering if there is a more elegant way to do it.
I have a number of shared variables being read from Modbus devices. The problem is that these can be turned off depending on needs. When the device is off, any vi attempting to read that shared variable waits for a time out, then gives an error.
What I have done is to put each read operation in a case structure and then have an array of booleans to say which ones are turned on (see screen shot). This works just fine, but I wonder if there is a better way to do this?
thanks,
mike
Solved! Go to Solution.
03-06-2013 06:20 AM
Replace all index arrays and cases with a single For loop and use 'i' connected to a case to choose which variable to read.
/Y