Currently, your code references attached devices by the id 'Dev1.' Change the constant that you've wired in the code to be the name shown in MAX. It's not necessary to rename the device in MAX at all, just have your code reference the name of the device in use. Be careful that you don't reference a device that's not currently plugged in, or you will receive an error.
I've actaully attached a VI that you can use to read the names of all your attached DAQmx devices. Use these values as the referene you pass to your code.
Let me know if you have any questions!
Elijah Kerry
NI Director, Software Community