Hey guys, I want to ask for your opinion on this issue,
I have a list of 1200 fault integers and their fault detail(usually nothing more than 20-30 characters each). I get the fault integer as a tag from the PLC and I can display it just fine BUT i’m trying to figure out the best way to match that integer to my list and display what fault that integer refers to.
Should I try to read from the excel file and match the integer to a cell and grab the corresponding cell or should I insert that list into a DB table and use a query to find what the fault string is? Is it there any other options that I haven’t looked at that might come handy?
This list of 1200 faults is only for one Press line and there are 6 more so I want to find the best way to tackle this issue since I will have to do the same for the other 6 lines. Thanks in advance for your ideas.
If the list rarely changes (new line, etc), I would put it into a database table with a column indicating what line it belongs to. Then use a non-polling SQL query in a client tag to read that table for a line at client startup. Then use lookup() expressions to pick out the text for display.
As far as I know the list shouldn’t change but I’m not 100% sure. I was so hoping not to have to put all that 1200 of them in an SQL insert code
In MSSQL, you can copy/paste from excel into SQL Server Management Studio. Stackoverflow thread
In MySQL, there is an Excel Add-in called: MySQL for Excel
Hell yeah! that will make my life soooo much easier Thanks for the suggestion.
Sorry, had to revise my link above to actually make it work…
Hey guys, I figured I add this here since it’s kinda about the same subject. So I have a folder full of Boolean bits, now these are technically the same faults as the excel list but I’m trying a different approach. so there are 7 cells and each have a folder that has all these bits as you can see below, now I trying to think of a way of going through each folder and say three tags Boolean are true, I want to grab all 3 names and display them, I’ve been trying to think of ways of doing it in the designer without actually scripting but I’m running out of ideas and feel like scripting is the only way, any ideas?
with expression and logic statements I can only check on tag at a time and I need to check them all so I feel like scripting is the better way since I have use loops to have it go through all the tags and grab that name of any tags that are true, am I on the correct path or do you all have better ideas I can try?
If they are all the same, I would create a template with all of the tags in it.
Use indirect addressing to set the folder part of the tag path, then set the visibility of each Label in the template based on the Boolean tag value.
[quote=“MMaynardUSG”]If they are all the same, I would create a template with all of the tags in it.
Use indirect addressing to set the folder part of the tag path, then set the visibility of each Label in the template based on the Boolean tag value.[/quote]
Thanks for the suggestion, my issue is I have table that shows the fault integers and I want to be able to show what that fault code means, I talked to IT and they are working on importing the fault codes/descriptions to a table on the DB. That would probably be the easiest since there are 1200+ fault codes.
In case anyone does this
I used a dictionary which I made in excel, then placed in a script.
The dictionary is in my project scripts, but on one machine I have the dictionary inside the script that uses it.