I wrote a FB to read the content of specific text files. It chooses a text file depending of the input "bRfidNo", for instance: bRfidNo at 1 would open 1.txt and save the contents on a local array in the PLC. It uses the "File Access" library and its function Blocks.
Thing is, when I use my FB on PLC_PRG and choose manually bRfidNo it works fine. But I wanted too by Startup of the PLC have it read every text file and add all its contents on the local Array. I wrote a Startup subprogramm which is basically a loop of my Read-FB until he readed everything, but it remains stuck on Case 10 of the FB.
Here's the Code of the FB. The "fbRead(xRead) remains stuck on true, so I'm suspecting I'm starting the input wrong on my Startup-program maybe?
fopen.xDone doesn't seem to turn on when I call the FB inside another PRG either, despite that I get no fopen.xError.
Hi all,
I wrote a FB to read the content of specific text files. It chooses a text file depending of the input "bRfidNo", for instance: bRfidNo at 1 would open 1.txt and save the contents on a local array in the PLC. It uses the "File Access" library and its function Blocks.
Thing is, when I use my FB on PLC_PRG and choose manually bRfidNo it works fine. But I wanted too by Startup of the PLC have it read every text file and add all its contents on the local Array. I wrote a Startup subprogramm which is basically a loop of my Read-FB until he readed everything, but it remains stuck on Case 10 of the FB.
Here's the Code of the FB. The "fbRead(xRead) remains stuck on true, so I'm suspecting I'm starting the input wrong on my Startup-program maybe?
fopen.xDone doesn't seem to turn on when I call the FB inside another PRG either, despite that I get no fopen.xError.
And here the Startup-program (I tried too with FORs, Ifs etc, no difference)
Last edit: epinikion 2020-10-23