From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problems programming in labview

hello, I'm new in labview programming and I need help. In my project, I would like to acquire and decode the signal irig b. But I have a problem with a sub vi, in the waveform chart that I added in my vi  (see attachment) I should see the waveform of the signal irig, but when I launch the program does not see anything, remains fixed at the value 1, where am I doing wrong?

thanks

Roberta

0 Kudos
Message 1 of 7
(2,602 Views)

I don't understand your program, but it is full of race conditions. You are writing to PPS twice in the upper sequence and, in parallel (!), you are reading from it and writing to the terminal. The results are unpredictable and depend on what happens first. Most likely the currently FALSE PPS local variable near the bottom is read first and the value sent to the indicator and chart while the sequence toggles the LED, but by that time the stale value has already be written to the chart.

0 Kudos
Message 2 of 7
(2,590 Views)

You are only updating the chart once. You also have a race condition because of the incorrect method of using local variables.

0 Kudos
Message 3 of 7
(2,588 Views)

..., where am I doing wrong?

thanks

Roberta


Many places. You probably need to go through the getting started videos and the tutorial.  You have missed some basic concepts of LabVIEW.

 

Lets look at some of the problems:

  1. the basic race condition

Capture.PNG

The PPS Indicator value will be True or false depending on whe the read local variable is read.  There is no data dependancy between the local read and the two local writes so the value of the indicator CANNOT be determined from the code as written.  Basic Dataflow: If all inputs are available the function may run.

2: Miss-use of dynamic datatype:

Capture.PNG

PPS is a scalar outside any loop structure.  Charts maintain a history of scalar values.  They can maintain a history of booleans.  The merge signal to cast to DDT is not just useless but it hides the data type for no good reason.  That dog WILL BITE you when you scale up the application.

 

3: Missuse of the Enum data type:

Capture.PNG

Where you cast [0,1,2] to [2,5,8] a Ring control would do that for you.Smiley Surprised

 

Seriously, Go through the tutorials.  Welcome to LabVIEW!


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 7
(2,581 Views)

thank you all! can you suggest me some tutorials about that can help me?

·

Þ · Jeff Bohrer how do I create a dependency between the local variables written and  local read?

0 Kudos
Message 5 of 7
(2,533 Views)

Those tutorials helped me, maybe they will help you too !

 

http://www.ni.com/academic/students/learn-labview/

0 Kudos
Message 6 of 7
(2,525 Views)

@frisk82 wrote:

thank you all! can you suggest me some tutorials about that can help me?


LabVIEW Basics

LabVIEW 101

 

Or if you have a current Service Support Plan (SSP), you can takes LabVIEW Core 1 and Core 2 online for free.Self-Paced Online Training


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 7 of 7
(2,482 Views)