04-18-2023 04:23 PM
Hello,
Using LabVIEW 2021 for this project.
I provided both the front panel as well as block diagram.
Front Panel: Options to Select file to scan and File to write to
Block Diagram: Picture2.png has 2 while loops in parallel, 1 with and 1 without file read delay.
Picture3.png compares the file lengths and runs a for loop for the differences between the current scan and previous scan.
I am having issues getting program to run and capture every change in file.
Upon startup it continuously writes the first line in the file it is reading until it captures a scan to compare it to.
It also appears to occasionally double up on some lines and prints them out multiple times, I can not seem to get the for loop to stop once it finishes running the set number "N."
04-18-2023 06:12 PM
We cannot run and debug a code from the images. Please attach your code instead.
04-18-2023 06:53 PM - edited 04-18-2023 06:53 PM
Here is attached VI.
04-19-2023 05:38 AM - edited 04-19-2023 05:39 AM
File Line Count VI Missing.
Have you tried using FileSystemWatcher, You can use this to trigger an event whenever there is a change in file, By which you can avoid reading the input file continuously.
04-19-2023 05:55 AM
Apologies.
Here is File Line Count VI
04-19-2023 07:19 AM - edited 04-19-2023 07:20 AM
Have you tried FileSystemWatcher, Too many while Loop and also all the Loops where running without any condition (Abort is the only option to stop Execution) which is not the recommended way.
Go through basics of state Machine architecture and try to implement in proper structured way (Application Design Patterns: State Machines - NI).
Also the Top Loops which reads files does the same functionality (except wait) any specific reason?
04-19-2023 08:20 AM
Was using the top loop with the wait function in order to compare to other loop to capture any changes.
Looking for an increase in # lines in file.
04-19-2023 09:28 AM - edited 04-19-2023 09:34 AM
How about something like this?