Try the attached VI and let me know if it works. I did some change.
Make sure the number of relays used matches the number of DO that you set as shown in the screenshot below:

I tested this code with my hardware and it seems to work fine. By the way, I am using USB-TC-AI from MCC Daq.
I'm here to help; I find joy in helping.
~Don't forget to accept best solution if you get what you want ~