04-29-2013 10:13 PM - edited 04-29-2013 10:18 PM
Hello all,
I am creating an monitorineg application on NI labview and DSC. In my pplication lots of parameters are monitored. These parameter values can create alarm message through share variables.
I now want to create an HMI page where alarm items could be viewed. On the page, I also want to have indicators showing total alarm quantity, active alarm quantity and unacknowledged alarm quantity. I want to have controls on HMI page which can acknowlege selected alarms and total unacknowledge alarms, controls which can show active alarms, unacknowleged alarms and all alarms, additional controls which print list of alarms and export alarms with different format.
I do not know how to create programming code to implement above functionality. Your help would be highly appreciated.
Some even more questions are: Can I store alarm message into a file and query it through HMI?
In my appliation there would be two users: standard user and adminstrator. standard user will only be able to read messages while administrator can acknowlege alarm message. Can anyone offer any suggestions on creating this functionality?
Regards,
Fan Tingdong from China Guangzhou
04-30-2013 08:25 AM
The LabVIEW front panel is your human machine interface. Your asking for alot so I can't really design your entire system for you. For an alarm indicator, LEDs work fine, unless you have a very large number of indicators. In this case you will need something more robust. A simple txt indicator can be updated programmatically to display urgent messages related to alarm status.
You can easily store alarm information using a configuration file. Each alarm will be represented by a key and the value stored will be either true/false for alarm state. Or you could wire a string as the value to store a message in the file. The Write Key.vi will update information of existing keys or create new ones if they do not yet exist.
It's difficult to give you tips on the best design methods without knowing more details.
05-01-2013 08:43 PM
Hello,
Thanks. Below is a HMI created on another developing environment. What I want to do is just to create similiar front panel on labview.
Could you please kindly offer more detailed information on how to create these functionalities on labview?
Regards,
Fan
05-02-2013 08:47 AM
For your alarm display list, you will want to use a MultiColumn list box with selection mode set to "1 or more". The information is accepted as a 2D array of strings.
You will want to use a State Machine architecture. http://www.ni.com/white-paper/7595/en The machine will consist of the following states: Initialize, Idle, 1 State for each button on the front panel, and a Close State for clean up & exit.
After initialization, your program will sit in the idle state where you can either do nothing but wait or periodically check your Display Options section for updates on how the multicolumn list box should look. Finally, the idle state will check the buttons to see if a state change is required.
Each state corresponding to a button will contain the code necessary for that function (this organizes your code by function and makes it easier to view/edit). Exporting can be simply done by wiring all or part of the multi-column list box to a "Write To SpreadSheet File" vi. Imports would be done using "Read From SpreadSheet File" vi.
All of your Alarm Function buttons will simply be modifying the contents of the Multi-column listbox (and updating a file). The SHOW functions will read in data from your file and filter it according to the button pressed (you might want to add a READ FILE state to your machine and have it decide which state to go to next for filtering). The acknowledge buttons will update the 2D array and overwrite the file. Your design looks like it will be keeping a log of alarms. In this case, a configuration file isn't really suitable since it would be used to store the current value of individual controls, not a complete history.
05-02-2013 08:48 AM
O, and here is a really good forum post on how to make buttons with custom appearances. http://forums.ni.com/t5/LabVIEW/Custom-Button-Nugget/m-p/1564566/highlight/true#M575295
05-03-2013 03:04 AM
Hello,
Thank you very much.
I create a VI which can implement the function "acknowledge all alarms".
But when I try to implement more functions with a State Machine architecture, I found I was unable to move forward...
I do not know to impliement functionalities like "show all alarms", "show active alarms", "show all unacknowledged alarms", "acknowledge selected alarms", "print" and so on.
Could you please add some codes in attached program? Or can you offer more hints?
Thanks in advance...
Regards,
Fan
05-03-2013 03:48 AM
Sorry I was unable to attach my program. Maybe the internet is too bad... (if you can offer you e-mail address to me, i will send it to you via mail)
But my program is quite similar to the one in below link.
https://decibel.ni.com/content/docs/DOC-25807
Can you add some codes, or offer more detailed hints?
Regards,
Fan
05-03-2013 05:29 AM
For example, how to save the contents in Multi-column list box into a file, and update it periodically?
How to distinguish active alarms and unacknowledged alarms and read it from the file?
Which file type should be sutiable? TMDS or text?
......
Regards,
Fan
05-03-2013 08:25 AM
Since you want to be able to read in alarms based on a certian status; active, acknowledged, all, etc. It would probably be best to creat and utilize a data base (ACCESS, SQL, or other). Since I have little experience with databases, I'll try to explain how to simply use a text file.
The "Write to Spreadsheet File" vi accepts a 2D wave and writes it to a file, which is convenient as the data from your multi-column list box is a 2D wave. Writing to file. "updating" is simply a matter of overwriting the file... check
"Read From Spreadsheet File" will be used to load data from the file... Check.
Since you will be reading in the entire file, you must use code to determine which values to wire to the multi-column list box (say for active alarms only). You will have set up the file so you will know which columns are which. Following your example image, column 2 is Time Acknowledged (column numbers start at zero). So, to get the acknowledged files only, used "Index Array" to extract column 2 (this gives a 1D array of 'Time Acknowledged'). Use a for loop to run through this array. If the entry has a string length greater than zero, it has been acknowledged and we should add the appropriate row to the multi-column list box (only add those with a length of zero if you want NOT Acknowledged).
Do you see the thought process here? Of course, this requires a lot of array manipulation and string evaluations to determine which rows of your file are to be displayed on the multi-column list box. The benefit of databases here is that you can directly query the database for subsets of information and it can be accessed from remote compters easily (but again I've little experience with this).
Just using a file like this, the actual file type doesn't really matter. What matters is how the data is stored within the file (i normally use txt so I can view it manually to check for errors). If you don't want end users to be able to access the file, switch to a data type not easily opened on the PC once the code functions as desired.
I forgot to ask before, how will your alarms be detected? Is this something you must do in the LabVIEW code? If so you may consider a queued state machine http://expressionflow.com/2007/10/01/labview-queued-state-machine-architecture/. The state machine will function as normal with a parallel subvi running which will probe for alarms and, if a new alarm is detected, trigger the state machine to add the new alarm to the file.
05-07-2013 08:48 AM
Hello,
The alarm is created through shared variable (with alarmming properties enabled.). So when the value of a shared variable exceeds an alarm limit, an alarm message will be created. The message could be read with "Read Alarm" VI and write to the Mutilcolumn List control via Format Alarm Data VI.
However, when I set the selection mode of the Mutilcolumn List control as "1 or more items", the alarm information was unable been writen into the Mutilcolumn List control(Format Alarm Data VI do not accept the Mutilcolumn List control with that selection mode ). Therefore I was unable to write the alarm information from Multicolumn List Control into a Spreadsheet file via the "Write to Spreadsheet File" vi.
Can you find an example where alarm information is written into a file? Or can you find such an example?
Can you offer your e-mail so that I can post my program to you? It would be easier to solve the problem you can see my program.......
Thank you......
Regards,
Fan