LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

My program doesnt give output as required, can u find the problem.

 I have written a program to send a 1 as output at the start of the run button and after user defined seconds of delay the value has to change to 0.
But in the program i have written the case selector line is 0 first and it has to give 1 as output, but it doesnt give 1 but after the user given seconds of time the case selector line is giving a 1 but the output from the case structure is no changing. What is the mistake I am doing here?

thanx

anand
0 Kudos
Message 1 of 8
(2,721 Views)

Hi Anand,

The indicators are only written once in your program. You can see this if you use the HighLight execution (lamp)

If you want you indicator to be a "1" at the start of your program you must initialize at the start of your program with a local variable. See program

0 Kudos
Message 2 of 8
(2,709 Views)
Hi anand,

you really should look into the manual (chapter on dataflow)!

Btw. I made some comments to your code...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 8
(2,705 Views)

the case selector line is giving a 1 but the output from the case structure is no changing
It will not change because your 'select' function will always get 'true' as its condition ( you are 'and' ing 2 'true' boolean constants) and will keep selecting case 1
 
Also, your case structure will get executed only once, that will be after your time delay. It will not execute once before and once after.
 
what is that you want to do exactly??
 
If it is to display 0 and 1  in your numeric indicator wiith a time delay inbetween, do as shown in attached pic
 
Regards,
Dev
 
0 Kudos
Message 4 of 8
(2,704 Views)
Hi ,
 
 Thanks for helping me out in the program last time. Now I have a problem with same program but not with maintaining the value 1 intially and then setting it to zero later, but now I need to add a data aquisition to the program which i have done but it doesnt record the input values through out the run time. Can you check with it and modify as required.
 
Thank you
 
Anand
0 Kudos
Message 5 of 8
(2,665 Views)
Hi Anand,

have you read the chapter on dataflow? Or did you read my comments on your last example?

I applied some comments to your vi. Have a look at it!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(2,647 Views)
Hi,
 
 I had a look at your program, its good but doesnt serve the purpose. its not capturing the data while the specified run time, i.e. it doesnt plot the graph as soon as the program runs, it is giving the data after the specified run time and the program doesnt stop and keeps on running.
 
Is there a way to get data get plotted on the screen while the specified run time, in my program.
 
Thank you,
 
Anand
0 Kudos
Message 7 of 8
(2,619 Views)
Hi Anand,

asking for the 3rd time: Have you read the chapter on dataflow?

When you want to run different things in parallel, you have to program it that way! In your program you first run a sequence (including this delay 'specified runt time') and, due to dataflow, AFTER this your while loop containing the DAQ part. To run things parallel there has to be NO data dependency between the block diagram structures.

So please, read the chapter on dataflow! It's important for basic understanding of LabView...

Best regards,
GerdW


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