LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Question about Arrays

Solved!
Go to solution

By the way, I just changed the mechanical action of the clear button, it is not in the version I uploaded recently.

0 Kudos
Message 21 of 31
(946 Views)

@TeamHalli wrote:

 

Can you please elaborate on your bulleted items:

 


Here is just a 2 minute rewrite, showing some of the point. Maybe it can give you some ideas. I haven't looked at the version with the subVIs.

 

(I don't handle the case where more than one boolean changes between polls, though. That would need a small FOR loop to find all, not just the first, changed element).

 

In principle, you can do all in one loop, using a feedback node to find the changed elements after each poll and update the highlighted cells array. 

0 Kudos
Message 22 of 31
(938 Views)

@altenbach wrote:
In principle, you can do all in one loop, using a feedback node to find the changed elements after each poll and update the highlighted cells array. 

And here is a version using a single loop for everything. (Not debugged, just a rough draft!)

0 Kudos
Message 23 of 31
(927 Views)

Thanks Altenbach.

So if the alarm list can change order all the time based on state (which is True or False) and priority level (which alarm shows at the top), i can have an order on the alarm list of Alarm 2, 5, 8, 9,12 at one time and Alarms 1,6,8,10 the next time. Is there a way to track where those alarms are or were on the listbox at anytime? The highlighting is using the index of the alarm not the order on the listbox. Is using a listbox appropriate for this application?

 

 

Thanks,

TeamHalli  

0 Kudos
Message 24 of 31
(919 Views)

Do you all have any idea on how I can implent a display for alarms, where any new alarm would be flashing and after the alarm(s) are ackowledged they will no longer flash until the alarm(s) go false and back to true again (which will make it a new alarm again).

Thanks!

0 Kudos
Message 25 of 31
(890 Views)

Yes, same thing. Just keep an additional array (e.g. boolean) in a shift regsiter, that contains information which alarms have already been acknowledged, for example. It could even be an enum with multiple states (no alarm, new alarm, acknowleged alarm, ignored alarm, important alarm, etc).

 

 

0 Kudos
Message 26 of 31
(874 Views)

I have only one Clear or Acknowledge button for all alarms, so I don't know how to keep track of each alarm individually if I am using a listbox.

 

Thanks

0 Kudos
Message 27 of 31
(868 Views)

You can keep track using a shift register. Create your own array of data that pertains to your list and keep track of what has been highlighted and what hasn't, etc.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 28 of 31
(862 Views)

You can keep as many arrays in shift registers as you want. No front panel object needed. Use it to maintain extra information for each alarm.

All your current logic code is trivial, so you would just add a few more checks and update the state details as needed. You could even keep information about when each alarm got triggered and then check if they are older than a certain time (e.g. when clear was pressed). There are many other ways to do these things, just decide on an architecture that is scalable and that makes it easy to keep track of additional information. You are not dealing with millions of alarms so memory is not of concern.

0 Kudos
Message 29 of 31
(857 Views)

Follow what altenbach suggests for sure.

 

I think you would also benefit from looking at the Simple State Machine template that ships with LabVIEW. This will show you an example of how to store a cluster of data through shift registers and keep track of your application as the user performs actions.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 30 of 31
(852 Views)