LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Table repeating values; cluster elements alternate between "0" and data

Solved!
Go to solution

Hello all.  Ok, this is a program we are designing to test temperatures of pump motors. The program you will use is Main (table state machine).  There are a few issues we need help with solving.  Here is how the program should work:

 

1.  When the program starts, the oil heater status comes on and the table shows temperatures.

 

2.  Please raise the temperature using the debug knob.  Once this temperature is equal to or greater than 200, the oil heater status will go off, the All Motors activated indicator will come on, and the timer in the cluster will start.

   a.  For debug purposes, the temp setpoint boolean is set to false to allow you to see results quicker.  You can set this to true to run the  time counter for the true test time (which will run in minutes)

 

3.  Every 5 seconds the setpoint will increment by 50, up to the max of 380.  At this point the Strip Heater status boolean will light.

 

4.  At any time after going past 200 on the temperature, please change the Current Limit debug control to a number greater than 0.  You will see "Tripped"  appear in the Status column of the motor(s) that exceed the limit.

 

5.  The table will be saved in a csv file.

 

That's how is should go.  Now are the problems we are seeing:

 

1.  When data is saved, the "Status" column grows and repeats.  If the Status says "tripped", this word will appear in multiple columns for the same motor, when it should only appear in one column.  So if Motor 1 trips, "tripped"  should appear only in column 6 of the table.  Instead it will appear in Column 6, then column 6 and 7, then column 7, 8, and 9, etc.  It gets even more crazy with multiple motors tripping and the same thing occurring.  Why is this happening?

 

2.  In the Oil Temp, Oil Setpoint, and Timer cluster, once the timer starts, a number of issues occur:

a.  the setpoint alternates between the starting value and the new value

b.  The seconds component on the timer alternates between 0 and the incrementing value.  So it goes 0, 1, 0, 2, 0, 3, etc.

c.  The oil temp indicator alternates between 0 and whatever the temperature control is set to.

d.  The oil heater status indicator alternates between on and off (true and false)

 

0 Kudos
Message 1 of 4
(869 Views)

Hi Dhouston,

 

cleanup that VI!

  • Remove local variables as much as possible.
  • Place duplicated code into subVIs (or use loops).
  • Remove Rube-Goldberg code!
  • Never hide labels of FP elements in the block diagram!

 

This way you will get more overview of the details in this VI to better understand what is going on…

 


@Dhouston wrote:

1.  When data is saved, the "Status" column grows and repeats.  If the Status says "tripped", this word will appear in multiple columns for the same motor, when it should only appear in one column.  So if Motor 1 trips, "tripped"  should appear only in column 6 of the table.  Instead it will appear in Column 6, then column 6 and 7, then column 7, 8, and 9, etc.  It gets even more crazy with multiple motors tripping and the same thing occurring.  Why is this happening?


I only found one place in the Main VI where you save data to a file: here you write temperature values into a spreadsheet file. How do you generate some "tripped" strings this way?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(860 Views)

Hello GerdW,

 

Ah yes, it's quite a mess I know.  My apologies.

 

In answer to your question about the saved data, the table is saved into the file.  If the table has "tripped"  in it, this will appear in the file as well.  Is it not happening with you?  Attached is the file with some data.  There are not thermocouples actually hooked in, so that is why you get the large temperature numbers.

 

Now in comment to you statements:

 

  • Remove local variables as much as possible.
  • - working on this
  • Place duplicated code into subVIs (or use loops).
  • -what code is duplicated?  It was all looking unique to me.
  • Remove Rube-Goldberg code!
  • -can you tell me where the Rube-Goldberg code is?  I thought I had that much cleaned up already.
  • Never hide labels of FP elements in the block diagram!
  • -My memory is failing me.  What are the "FP elements" and labels you speak of?

    Thank you for even attempting this.  I know it is a mess.

 

0 Kudos
Message 3 of 4
(846 Views)
Solution
Accepted by topic author Dhouston

Just giving and ending update.  We fixed the issues we had seen.  The constant "0"  that keep appearing was due to improper wiring of the cluster to the shift register between each state.  There were some states where we did changes to the cluster data, but instead of wiring that change back to the shift register, I wired the original cluster from the start of the program.  That cluster had all 0 values, so Labview was alternating between the changed values and the original value.

 

The growing column in the csv file was due to the Insert Array function, which was growing the table at each save.  We played around with Replace Subset and a few other things and got it all to work.  So our problems are now resolved.

Message 4 of 4
(771 Views)