i'm using a watch node for checking if there are changes in file. This works if i open a file and save it's contents manually.
But the problem lies with the fact when a siemens comfort panel is writing it's log over the ethernet to the file the file is overwritten but it's only changes it's modify date if i select the file(doesn't even have to open the file). So is there another way to read the modified time that's trigger the file?
Every time the siemens panel writes a new alarm to the csv file i want node red to know. So i can load the file and read the last alarm.
And i thought the way to see if there is a change in the file you could do it with the date modified. And like i said it works but i have to select the file (not open just select the file in the folder so the data has been written) if the date will be updated. So to clarify it's not explained very well in the earlier post, but i meant is there a way to do what i do when i select the file to update the date. Not to overwrite the modified date.
That's indeed the strange thing about it. If there is a new alarm and i go look at the directory is see the old date. And no matter how long i wait i have to select it before it does a update of the time.
And a soon as the date is updated node red sees it. So node red is handling it fine, it's windows who don't update it automatically.
So that's why i wanted to know if there was another way?
I've got a shared folder on the PC where node red is installed. And the Siemens Comfort Panel write over the ethernet to that folder.
That works because if i call my alarm buffer on the comfort panel it's displaying them. And if i disconnect the panel from the ethernet, it can't find it's folder and don't display anything.
And that may be your problem. I would recommend reading up on filing system watches. Network shares in particular are a problem. You may need to write a polling flow.
Can you grab the last accessed date (core to Windows API) of the file? Sometimes developers read the file before they write to it? So if last access date/time can give you a clue of when to poll for an update. Thus you would not have to poll 24/7 but only after the last accessed date/time changes? Just a thought.