For context, I'm new to Labview and programming as a whole so please bear with me. I'm attempting to control 128 relays using Labview and I settled on using a 128-bit boolean array then converted to hex in a For Loop to do so. I've attached a screenshot of the relevant part of the code. The problem I'm having is there seems to be some sort of overflow going on, specifically with every 8th bit. For example, when the 8th bit is selected high it also makes the 9th bit (the 1st bit in the next byte) high as well. I'm assuming I'm using something incorrectly. I've also noticed that the For Loop is converting the 1-D array into a 2-D array upon entry into the loop. I'm assuming this is apart of its design but I suspect it is apart of the problem?
Thanks for the help,
Please upload your VI instead of a picture of your block diagram.
Just from looking I assume the decrement function inside the for loop to be your culprit.
I just don't understand the defective, but-very-common, psychology here.
Attaching the .vi is less work than making an image of the block diagram, then posting the picture; yet a lot of people do that.
One time I needed my cow-orkers to run a little program to collect some info about their computers. The program displayed a data string, and also copied it to the clipboard (and displayed a message saying that it was in the clipboard). All they needed to do was create a new e-mail message to me and press Ctrl-V. But a couple of them took pictures of the screen with their phones, transferred the picture to their computer, then e-mailed me the picture (so of course I had to manually type the info from a picture).
People seem to have an urge to do extra work that makes things more difficult for anyone trying to help them. It's troubling that such a high percentage of people are afflicted with this psych defect.
Just like I already said, the decrement ( -1 ) operation inside the for loop is incorrect. You are taking sub-arrays, starting at index -1, 7, 15, ... but you want to take sub-arrays starting at index 0, 8, 16, ...
Here's another possible solution, that first reshapes your 1D-array to a 2D-array.
Further proof of my inexperience. I appreciate the solution and the help.