Ok lets divide and conquer. As for the shift information it is nothing more than an int, so yes it can be written to the PLC. And as of this posting it is being written to the PLC. So that is not a problem. Currently in the PLC we have several registers that are setup for operational characteristics of the machine, ex. Operator, Batch number, assistants as required, and others. These are all written to the PLC from the IA software or can be done at the local level with proper admin privledge. Next we have a boolean bit which is the trigger to write to the compact flash on the PLC, this is the bit that is being monitored thru FPMI, when this bit is active it also polls the OPC server and writes the same info that is being written on the flash to the SQL server. Currently we are in the process of validating the data. This was the reasoning behind the whole timing post elsewhere on this forum. Our DB staff is currently making a little program to take the CSV files created on the flash card, load them into a temp SQL table, then using some sort of comparison compare the temp table to the SQL table. If any discrepancies arrise an alert of some sort will be issued and someone will look over both tables to find out what the discrepancy is and make any required corrections and notifications. We are also in the process of making other screens based on requirements.
A few issues that are still a slight thorn are my time sync section which for some reason still hangs up, the hourly count off, and SQL tags. I am hoping the newest version will correct whatever may be causing the issue. Or who knows it might be something on my end. What is happening is I have SQL tags which will allow a different screen to be shown if they are active. And even if they are not active they still sometimes allow the user to go to the other screen. It could be as simple as an update rate, dont know. But if it were an update rate, and my rate is set at 2 seconds, and I do nothing on the screen for 10 seconds it still allows access to those screens. Not sure but am doing what I can.
As for your ideas I will put them on the table at the next meeting and see what comes about. Any other questions please feel free to post I will do my best to answer. Have a great day.
Ok, let’s divide and conquer…
Our first task is to make sure we have enough information to determine when an operator is in charge of a machine. If you are logging the employee ID entered into the PLC register for the machine, we’ll have that information.
Note: You don’t have to log the employee ID on a timed/periodic basis. You could configure FactorySQL to log only changes to the employee ID which is way more space conservative.
The second task is to historically log the shift to which the employee is assigned. There are multiple ways of accomplishing this, depending on where the information resides.
If the shift assignment information can be written, along with the employee ID, to register(s) in the PLC, we could simply log them like the employee ID.
If the shift assignment information cannot be written to PLC registers, then we will need to get the shift assignment information directly from the Kronos database tables.
The simplest way I know to do that doesn’t even involve FactorySQL, just SQL Server. You or your IT DBA could define another ‘historical’ shift assignment table. You can then define a trigger on the ‘realtime’ shift assignment table that will log any new assignment to the ‘historical’ shift assignment table. You would need to make sure you put enough information into this ‘historical’ shift assignment table so you can link the employee, by ID, with the historical assignment records. This linking would only actually be done when generating your reports.
The third task is to determine whether the employee was working on 1st or 2nd shift as defined by time (i.e., 4 am - 4 pm, and 4 pm - 4 am). The data collection part of that is trivial. The time stamp (i.e., t_stamp) column of your table tells you that. What’s more difficult is processing the data for your reports. You have to do something like query for the first instance of each unique employee ID over the shift time-frame. Writing this query can be a little tricky, but it can be done.
If I’m missing something about your particular installation that makes this approach not work, just let me know…[/quote]