Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Alarm control

 

-What is the purpose of the Current File indicator.  You have it listed as n indicator, then your read from it to build your array

I wish to log the status files for each time, especially for the alarm conditions. I modified the VI. Please see.

-Why do you initialize an array that is 10x4, then run your for loop 50 times and your inner for loop 10 times?

Actually I want that the status of the motor availble and not availble will be shown in the table, for 2 status. But I am not sure how I can manipulate array for the status, I saw some code similar to my situation

-What are you trying to accomplish with each loop iteration?  Do you want to read from your alarm status and write that to a file?  If that is the case then you need to be reading from those controls inside your loops.  Right now it just seems like you create an entry in your table if there is an alarm, without any further relevant information.

Yes I want to create an entry to the table.

I want to read from the alarm status and display it

-What is the purpose of having a Boolean 2, Emergency, and Buzzer indicator, they all seem to be displaying the same information

 I have emergency and buzzer so I want to add both of them though with the same condition for the alarm.

The second VI with more added:

 

-What is the PT?

Pressure transmitter

-What do hihi, hi, lo, lolo mean, it looks like you just iterate through those each time, but using the same numeric control to check.

Different conditions of the PT hi, HI HI, lolo, low, its should shown in the table.

-To create a pop up notification, use the "One Button Dialogue" function

 Please the attached.

Let me know how this goes!

Download All
0 Kudos
Message 11 of 20
(1,112 Views)

Hi KRAZE4LV,

 

Ryan is out of the office at the moment, so I've looked through your latest VIs. Let's focus on the first VI for now. From what I can see, your code looks a little more complicated than it needs to be, particularly for updating the table control. Take a look at this forum post (the 2nd one) for a simple example of how to append data to a table control. Next, to add the ability to write the same data to a measurement file, you can use the Write to Spreadsheet File.vi. See the code snippet:

 

write2file.png

 

Give this a try and feel free to post again if you have questions or want to move onto the 2nd VI.

0 Kudos
Message 12 of 20
(1,097 Views)

Thanks Joseph, I have modified my VIs to achieve the condition about the alarm condition.

1. In the VI when we run the program, based on the conditions the valve change the condition on/off but they dont stay at one position until condition is changed, they just switch on/off immediately. I want they should stay in one condition until PT value is changed.

2. In the table the value should be shown in another row for other condition but it shows only one row and keep changing in the same row.

3. I wish if the status of the PT is HiHi, in the table it shoudl show the string HiHi, Lo, LoLo and Hi, how can i introduce these conditions in the table?

Please suggest and please the attached VI.

 

0 Kudos
Message 13 of 20
(1,084 Views)

Hi KRAZE4LV,

 

To solve issue 1 you shoud set a variable or shift register that keeps the value of the indicator until it changes, you should also take a look at the states from the case structure when you are not connecting anything to these terminals, this might be the error.

For issue 2 I think that you need to use insert into array instead of build array to add more rows.

For issue 3, I think you should use a typecast to convert from the numeric control to a string that can come from an enum type.

I think that with these changes you will be just fine.

 

Regards,

steve.bm
AE | NI
0 Kudos
Message 14 of 20
(1,074 Views)

Sorry, but couldnt solve it. Please see the attached.

0 Kudos
Message 15 of 20
(1,063 Views)

Hi KRAZE4LV,

 

Could you clarify which of your issues you're still having problems with?

 

It looks like you are still having a problem with issue 1 (your switches changing state after every iteration). Could you comment your code in regards to the pressure transmitter? What behavior would you like to see from the PT? It seems like the loop is changing the switch indicators correctly.

 

Running your most recent code, it looks like issue 2 (putting values in new rows) is working. Let us know if this is not the case.

 

For issue 3, I posted a link to the function manual for the Type Cast function below. This should help you get that function working properly. It looks like you need to have a string type input to the top connector port of the function to create a string output. Also, make sure you only have the enum value as an input to the Type Cast function.

 

http://zone.ni.com/reference/en-XX/help/371361H-01/glang/type_cast/


Regards,

Zach P.

Staff Software Engineer | LabVIEW R&D | National Instruments
0 Kudos
Message 16 of 20
(1,040 Views)

Could you clarify which of your issues you're still having problems with?

 Thank you for your suggestions!

It looks like you are still having a problem with issue 1 (your switches changing state after every iteration). Could you comment your code in regards to the pressure transmitter? What behavior would you like to see from the PT? It seems like the loop is changing the switch indicators correctly.

 Actually if I want PT of the range 0-10 bar, at 5bar PT should ON i.e true but it keep switching on and off same at PT>10 the buzzer and emergency should open i.e true but it is on and off all the time. Its not stable.

Running your most recent code, it looks like issue 2 (putting values in new rows) is working. Let us know if this is not the case.

 Yes its woking well.

For issue 3, I posted a link to the function manual for the Type Cast function below. This should help you get that function working properly. It looks like you need to have a string type input to the top connector port of the function to create a string output. Also, make sure you only have the enum value as an input to the Type Cast function.

 I tried with typecast but I dont know which sting input should I connect. Secondly I found some way to convert into string as shown in the attached VI, But in the fourth column I cannot see the status as Hi, Hihi, LoLo etc.. I

0 Kudos
Message 17 of 20
(1,029 Views)

Hi KRAZE4LV,

 

Watching your code run with highlight execution on might help show what exactly is happening with your Boolean switches. It looks like the switches are constantly turning back off when your case structure goes through the Hi and Lo cases. For these, you need to wire the output of your conditional terminal inside the case structure to the Boolean switches. The current code is sending a False Boolean to the switches for every Hi and Lo case.

 

Your case structure is built as a state machine that cycles through its states continuously in the order of HiHi>Hi>Lo>LoLo. Is this correct?

 

For issue 3, it looks like you were able to get the correct string output using the Format to String function. Could you send the output of this function straight into the input of your Insert into Array function?

 

Regards,

Zach P.

Staff Software Engineer | LabVIEW R&D | National Instruments
0 Kudos
Message 18 of 20
(1,019 Views)

 

Hi Zach P,

 

Watching your code run with highlight execution on might help show what exactly is happening with your Boolean switches. It looks like the switches are constantly turning back off when your case structure goes through the Hi and Lo cases. For these, you need to wire the output of your conditional terminal inside the case structure to the Boolean switches. The current code is sending a False Boolean to the switches for every Hi and Lo case.

I put the switches inside the case structure. Still the switches move back and forth.

 

Your case structure is built as a state machine that cycles through its states continuously in the order of HiHi>Hi>Lo>LoLo. Is this correct? Yes

 

For issue 3, it looks like you were able to get the correct string output using the Format to String function. Could you send the output of this function straight into the input of your Insert into Array function?

No it gives error

 

See the attached!

regards,

 

 

0 Kudos
Message 19 of 20
(982 Views)

Hi, right now it doesn't matter where your switches are, but what wire you connect to them.  You still have the false being wired to those switches, instead of the output from the conditional terminal like Zach mentioned.

 

Next, for the error, this makes sense.  You are trying to add a single element to a 2D arrray.  This is not possible.  If you want data to be a 1D array, then this function will work.  If you want to add the string to the current 2D array, you will have to use a different function, like Insert into array, or replace array subset.

 

Ryan

 

Applications Engineer
National Instruments
0 Kudos
Message 20 of 20
(967 Views)