Hi,
I use wago datalogger in my project and I save all the data on usb stick connected to TP600. I would like know if USB is connected to the TP600 or not. What command should I use ? I would like to add USB icon on visu and connect the status info to it.
Best regards
How about using a Directory Reader function block from the WagoAppFileDir library? This should let you check to see if the /sd/media folder is present by examining the Result Code after triggering the function block.
Thank you for your reply. I defined this block like below. What I understand to the “sDirname” I must give a full path e.g. ?
sDirname :STRING := ‘/media/WW_SD.SgWHyC/CSV_FILES/’;
Can I set a trigger to TRUE to ask the block all the time for the file ?
You are correct about the full path of the directory.
You could cyclically call this function block to check for connection, but there is a caveat. Many of the function blocks in that library are considered blocking (i.e when they execute, they will tie up a task until their execution is completed. Care must be taken to ensure you project is not held hostage from the call. I would place the call of this FB into its own task with a lower priority than all other tasks. I would also only all as often as reasonably necessary. Perhaps say ~ 5 Second intervals. Once a result is posted in the output (good or bad) I would set trigger low and xOpen to low