02-11-2014 02:12 PM
Hello fellow coders,
I have a little program that reads some process transmitters and controls valves through modbus.
When I added code to save this data to a spreadsheet, the control valves stopped working on continous run and only work once I stop and start the program.
The code is in a disabled box in the vi
Solved! Go to Solution.
02-11-2014 02:25 PM
Data flow. Your outter loop can't iterate until everything inside of it is complete. This includes the loop you have to do the logging. And that loop isn't even needed. Just remove the loop that is around the logging (keep the logging code though).
02-11-2014 02:27 PM
Well, saving the same exact data every 30 seconds until you press an off-screen button (The "Unlabled Stop") was probably not what you really wanted to do. In fact, the while loop around the write to spreadsheet file code is only going to cause trouble. 30 second delays in loops the user interacts with will probably just irritate your users too! They aren't usually that patient and will almost always hit the dang abort button after just a few moments- that's often "not good".
02-11-2014 03:45 PM
I dont wat to save it every 5 times a second, how do I save it every 30 seconds without a loop+delay?
02-11-2014 05:07 PM - edited 02-11-2014 05:24 PM
tick count?
02-11-2014 05:11 PM
Elapsed timer Express.vi and a case structure around the write to file code driven by the "Timer Expired" Boolean would make more sense.