From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-14-2014 12:31 PM - edited 04-14-2014 12:32 PM
this hint....
with a simple statemachine
04-14-2014 01:03 PM
@Atwalsh wrote:
I'm also having the same problem with writing to a file at midnight. However, I cannot open the VI you uploaded due to my LV version being older than version 13. Could you possibly explain how to modify my VI so that it writes to a new file at midnight?
Thanks,
Walsh
As Apok hinted you need to modify your code to use a simple state machine format. Have a seperate state for writing your data to a file. Each time you write to file, check the "Day of year" to see if it has changed from last time you wrote to the file. If it has changed close you current file and open a new one. If no change then witre to the alredy open file.
04-21-2014 11:38 AM
I'm starting to understand some of the logic behind the state machine, but the way the code is written in the image posted by apok, it doesn't seem that there is any writing of data to a file between the creating and closing of the file. That I think I can modify, but more importantly, how do I find that function, "day of year", attached to seconds to Date/Time function?
04-21-2014 11:42 AM
04-21-2014 11:53 AM
Or just use the write to measurment file express vi configure the darn thing to start a new file at 00:00 daily.
04-21-2014 12:17 PM
Thanks Dennis,
What about the functions that are attached at various shift registers that have the ability to "wait" and "newfile"? Sorry, I just don't know the name of these functions and can't download the example vi due to my older version of LV.
04-21-2014 12:47 PM
04-21-2014 12:47 PM
Nevermind, I found they were enum constants from the numeric pallete.
Could someone explain if the picture above is actually writing data to the file or if that is something that I need to add in? Also, I'm not sure what is attached to the "strip path" function. I've pretty much written out the entire code minus the data generator because I have my own data source.
04-21-2014 01:12 PM
Here's my new code. I'm getting an error message saying that the case structure selector values have the wrong type. Any ideas on how to have the values read eachother/match up?
04-21-2014 01:51 PM
You have different enum constants. One has a value of 0 for wait, and nothing else. Another has a value of 0 for New File, and nothing else.
You need a single enum that has two values of Wait and New File. Then you should make that enum a typedef control so that if you go and add more states later, all instances will be automatically updated. Change all of your existing enum constants to a constant copied from the typedef control.