You will complete a VI, which will look up usernames and passwords in a Cluster Constant Array and return a person-id, if the username/pw are present and right.
Instructions:
- Download and open ClusterLogin.vi
- First create a Cluster Constant Array with usernames, passwords and person-ids:
- Copy the Persondata icon on the Block Diagram and insert this under the while loop
- Right-click the icon and choose "Create constant"
- Expand this (output border, not the individual elements) and then expand the individual elements
- Right-click each element in the cluster and choose "Visible Items -> Label"
- Move the elements away from each other, so you can read their labels
- Delete PersonData2 and the calbe, connecting the icon to the Cluster Constant
- Create a Control Array (Programming -> Array -> Array Constant)
- Pull you Cluster Constant into the empty cell by clicking and dragging in the border around the Cluster Constant
- Expand your Cluster Constant Array to contain 4-5 cells
- Fill them with user names, passwords and person-IDs
- It should be looking like this (apart from the specific user names/passwords/IDs)
- Connect your newly created Cluster Constant Array with the blind cable below the loop
- At the label: "Cluster Constant Array"
- Create a function, that will show the size of the Cluster Constant Array minus 1 and connect it by the mark "Array Size - 1"
- Read the name and password (and only these) from the Cluster Constant Array and connect them to their respective inuts from the Login cluster besides the equal signs
- Fill the True and False statements of the Case Structure
- True:
- Set status to found
- Read the found data into "PersonData".
- False
- Set status to not found
- Reset Persondata:
- Set the two text strings to "Empty String Constant"
- Set Person-ID to 0
- True:
- Run your VI with right/wrong logins and notice if everything works as expected
- Save your VI