View Full Version : More Log file questions
donek
01-31-2015, 09:35 PM
I would like to put a check at the beginning of certain file to check the last time a different file (table surfacing) was run. If it's been more than a week since the particular file was run, then it won't allow the user to run the file. Is it possible to perform such a check?
Brady Watson
02-01-2015, 08:07 AM
Sean,
In a prior life I designed and built an MES system to automate data collection on the shop floor. Touch screens, barcode scanners - SQL Server back end to collect the data (800 person facility).
The control software really isn't deigned to be an employee management interface. You can ask the operator questions or make suggestions, but he ultimately can circumvent them by lying to the computer. There is no reasonable way to do what you are asking and have it work 100% of the time. The employees need training & a manager to crack the whip and check on them. Same as it ever was.
It may be possible to fool around with shelling SB3 with EasyMode et al to minimize the commands available to an employee, but you'll have to decide if that makes sense. You have to keep in mind that there is always going to be some civil disobedience around these types of 'harnessing systems' - they will be met with reluctance and the possibility of sabotage because they 'don't wanna' goes way up. You have to make sure that your 'scheme' is iron clad - by testing it thoroughly - or you won't get a good reception.
The solution could be as easy as, Monday is flatten the table day...or whatever day it is. It then becomes habitual and part of the process without a computer 'overlord'...
-B
donek
02-01-2015, 01:29 PM
I understand that I personally could over ride such a system, but most of my guys running my machines have very little experience beyond navigating to a file and executing it. This is on purpose and because higher knowledge of the system is really not necessary to load a part and hit go.
I would like to implement two programs right now. Both would be in the custom codes list that would be called from within certain programs. The first would perform the following:
1. check the date the table surface routine was last run
2. compare the present date to determine if it's been more than a week
3. If the time period is longer than 1 week then
- check the number of cores cut with this cutter
- if limit is exceeded request the cuter be changed and perform a C3
- perform a table resurface
4. If time period is less than a week proceed to the end of the program
The second program would be placed at the end of a core profile program.
1. Open a data file and read a variable
2. add 1 to the variable (count)
3. overwrite the file, storing the new number.
I have been reading some of the programming manuals. I see it is possible to read and write to files. The shopbot code obviously uses a date variable somewhere within the code when it writes a log file. What I can't locate is the system variable for date or a command that allows me to call up the date. This is really the only component I am missing in implementing such a system.
bill.young
02-01-2015, 08:44 PM
Hey Sean,
It's been a long time since I wrote the ShopBot Odometer and dug into the system log, but I think you can get everything you need by parsing the log file using whatever programming language you're comfortable with. The Odometer is written in an old version of Visual Basic, but any language that can read and write text files will be fine.
You could read the log file and begin by throwing out all the files that ran in preview or didn't run to completion. Then loop through and find the most recent run of your surfacing routine and...assuming you have a common naming scheme for your core files...find all of them too.
The log file is written using the system date and time on your computer, so you would compare the current date and time to the date that the surfacing routine was last run. If it's more than your threshold time value then count the number of core files since that surfacing date.
I don't know how often you need to do this or how automated it needs to be, but you could probably do it all using macros in a spreadsheet too.
I think this would give you the data you need, but not sure how you would use that data to let the operator know what do. If you just wanted to know at the start of each day you could run it yourself and then tell them if they needed to surface, but if you wanted them to check after every file ran without them having to think, it would take some thought.
Hope this was a little help,
Bill
donek
02-02-2015, 12:19 AM
The difficulty is Bill, that I want to do it within a part file. Everytime someone runs a part on this machine, I want the part file to check that status and if it's time to resurface, force the operator to resurface.
This means it all has to occur in the sbp part file programming language, not some other language.
adrianm
02-02-2015, 03:44 AM
The SBP language has the ability to call external programs via the SHELL command.
One way you could do it is to call to a program that checks the last run date and then writes a true/false to the registry which the SBP file can then read (via GetUsrVal) to see if it's ok to proceed or not with the rest of the file.
I do a similar thing with the custom touch screen interface I use for my 'bot and it works well.
Powered by vBulletin® Version 4.2.2 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.