10-03-2014 02:27 AM
I want to read constantly and write TCP commands in separate loops as shown in the following attached VI.
I know it's messy code but it works. It's just that I know there has to be a better way of doing it, and this is one part of my bigger VI and I'm sure this is what is slowing it down and making it go crazy (over time).
Any input would be excellent!!!!!
Cheers.
10-03-2014 06:42 AM
1. No need for the sequence structure. You have enough data flow to initialize the important things.
2. Get rid of the wait in your top loop. The Event Structure "sleeps" when it is waiting for an event. So the rate at which you get events will limit your loop rate. Right now, you are limiting the rate of events to 5 seconds! That is an eternity! And there is absolutely no need for it.
3. There is no need for that "Zero" button. Just use the data from the User Event in your event case. Actually, there isn't even a need for the case structure in that event case. It will always be TRUE when you get that event.
10-07-2014 04:56 PM
Thanks mate, good feedback. That's how I did it originally and then for some reason it didn't work, so I added in extra unnecessary stuff then it worked. In the end it was a timing issue (that's why I put the massive wait in). All good now! Thanks again.