LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to extract real time data from a while loop for a case selector in another case struct

Hi!

 

I am currently designing a program for annealing Ni(110) sample using Keithley 2260B-80-27 power supply! I am trying to extract a real time data (not the last value of the loop and I tried different choices in loop tunnel options) from a while loop for a case selector in a Case Structure (see the attachments). The attached program works fine in separate cases. 

 

Actually, the purpose of this program is that it suppose to anneal the sample at every 30 seconds with a constant current but in the increasing order such as 5A, 10A, 15A, 18A and 21A. Then we keep the sample at 21A for 5 minutes and then follows the same procedure in reverse order to bring the sample to Room temperature! to The temperature of the sample is measured from a thermocouple which is connected to Fluke 8808a Multimeter to read the voltage (mV). For avoiding the sample gets over heated during 5 minutes at 21A, we were used to decrease the current manually little amount from 21A to maintain constant temperature (30mV for the K type Thermocouple). Therefore, the attached LabVIEW program is currently on the design for this purpose!

 

I would appreciate any advice. 

Thank you very much in advance for your help!

 

Best Regards;

Lakshitha

 

IMG_0065.JPG

0 Kudos
Message 1 of 10
(4,013 Views)

Hi lakshitha,

 

the image shows some misunderstanding of DATAFLOW:

The loop runs until "stop" button is pressed, reading new samples at ~10Hz samplerate (I guess).

The case structure is run just once.

Which of those "realtime values" do you need?

 

Please don't use the term "realtime" for such things. Realtime usually is related to something different!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 10
(3,992 Views)

You need to start with some basic tutorials about dataflow and code architecture, because your code makes no sense. By the time the "x+y" indicator is updated, the case selector has already been read and will never be read again during that same run.

 

Explain in detail what the program is supposed to do (not how you are trying to solve it!) and somebody here will point you in the right direction.

Message 3 of 10
(3,989 Views)

Producer/Consumer


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 10
(3,965 Views)

If your two loops (I'm assuming the case structure will end up inside a second loop?) run at different rates, then you might want to consider using a Notifier rather than a Queue in the traditional Producer/Consumer design.

 

This will allow one loop to produce notifications as to the "latest value", and then the other can run at whatever rate it likes (so long as the values don't need to be strictly synchronised, and the "latest" is good enough). 


GCentral
Message 5 of 10
(3,952 Views)

Hello cbutcher,

 

I am just wondering if a shared variable would do the same trick as a Notifier?

Jakob_Pin_0-1585601594207.png

BR,

Jakob

Message 6 of 10
(3,938 Views)

Hi Jakob,

 

yes, with much more overhead…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 10
(3,921 Views)

Thank You All for your support! Finally, I could solve it! Yes. Adopting everything into one loop and the introduction of the flat sequence structure finally made it possible. Thank You again!

 

A part of the final LabVIEW program is attached.Screenshot of the LabVIEW Program.PNG

0 Kudos
Message 8 of 10
(3,027 Views)

Hi lakshithadinusha,

 


@lakshithadinusha wrote:

Adopting everything into one loop and the introduction of the flat sequence structure finally made it possible.


Oh boy…

 

  • "The introduction of a flat sequence" shows you still miss the "THINK DATAFLOW" paradigm (even two years later)!
  • All those InsertIntoArray functions in the left frame show you still don't know how to handle arrays properly (using BuildArray).
  • You still don't know how to create and use subVIs to cleanup your code base…

@lakshithadinusha wrote:

Finally, I could solve it! Yes.


When it works for you then it must be ok… 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 10
(3,021 Views)

Thank You GerdW for your feedback. Yeah. It might take time for me to get whole idea of LabVIEW programming. This program works fine and at least does the job. So I am happy. 😊😊😊

0 Kudos
Message 10 of 10
(3,015 Views)