LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to compare successive readings using Labview

Using Labview (Ver. 6) with a DAQ instrument, I scan 20 Thermocouple channels, compare the reading of each channel, after every reading, with previous reading to see whether it is stabilized. When all the channels are stabilized within a given tolerance, then a signal is generated for the next step. As it is, I am using a While loop and shift register for each channel(each While loop is within a Case), and then AND the outputs of all the channels (shiftregisters). This is very messy! I think there should be easier way to do this. Help Please!
Thank you
0 Kudos
Message 1 of 5
(2,903 Views)
A messy diagram may be the only way to do this.

You might consider reading the data from the thermocouples as an array of channels. This way you will need to pass only one array in the shift register then compare with the equal function. It works both one element at a time and also for the whole array. you can togle the behavior by right clicking on the equal function and making the appropriate selection from the menu.
0 Kudos
Message 2 of 5
(2,903 Views)


Not sure if you're using the Datalogging & Supervisory Control (DSC) Module. But since you posted your query under DSC, I will answer this assuming you are. In which case this problem becomes trivial:

For the Tags of these channels, you need to specify the right Update Deadband. And the DSC Engine will then take into account this deadband when a new value comes in and does not update it until it has crossed the deadband. All this will be hidden from the user and you don't need to write a single line of code, or actually, a single millimeter of wiring 🙂

Again, if you're not using DSC please disregard this (but do appreciate the power of DSC to handle such issues!)

Regards,

Khalid 🙂


0 Kudos
Message 3 of 5
(2,903 Views)
Thank you Khalid.
Unfortunately, I am not using DSC.I am actually using a DAQ system to collect temperature data using thermocouples (up to 20 channels). And write the data to spread sheet. I want to compare successive readings in order to detect when temperature on all channels is stabilized. In order to do this, one simple method maybe to read the last reading, from the spread sheet and compare it with the current reading. I have no problem writing to excel, however I am not sure how to read the cell, right after writing to it.
Regards
0 Kudos
Message 4 of 5
(2,903 Views)
In my opinion, Jeremy's suggestion of using an Array for the channels and then comparing using shift-registers is better than reading back the data from the Excel each time. File IO will definitely be more costly (resources wise).

To read from Excel, otherwise, you may use the 'Read from Spreadsheet File VI.'

Hope this helps,

Khalid 🙂


0 Kudos
Message 5 of 5
(2,903 Views)