LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with a string local variable

I'm currently working on a vi that takes voltage % input and outputs a light, status message, and asynchronously give an auditory warning. I'm running into an issue with getting the local variable used for the auditory warning to update correctly each time, currently it will run correctly the first time but any subsequent runs it will output this previous runs value. I've tried initializing the value of the local variable at the start of the run, however that results in the warning never outputting the correct value. Any pointers on what I'm doing wrong?

0 Kudos
Message 1 of 8
(222 Views)

It is probably caused by a race condition in your code.

 

Attach your code (*.vi file) so that we can help you.

Also keep in mind most people on the forum do not have the most recent LabVIEW version, version 2021 would be ideal.

If your version is more recent, do File > "Save for Previous" > 21.0.

 

Regards,

Raphaël.

0 Kudos
Message 2 of 8
(215 Views)

@mhataro2 wrote:

 Any pointers on what I'm doing wrong?


It could indeed be a race condition, or just a misunderstanding of how dataflow works, or a mistake of any other kind...

 

A text description of what you want the code to do doesn't cover mistakes in implementing it. So it doesn't help us spot those mistake(s).

 

Without seeing the code there is no way to help..  Even a screenshot (pref. embedded, not attached) is better than nothing.

0 Kudos
Message 3 of 8
(206 Views)

@mhataro2 wrote:

Any pointers on what I'm doing wrong?


Probably more than one thing but as has been said, it is impossible to tell without seeing code. Here is a small set of possibilities

 

  1. Race conditions
  2. Dataflow issues
  3. Glaring programming errors
  4. Basic misunderstanding of local variables.

 

 A local variable is just a secondary read or write access for a front panel object. You don't "initialize a local variable", you initialize a front panel object (control or indicator), which can be done via a local variable, of course. What updates the terminal during the run?

0 Kudos
Message 4 of 8
(134 Views)

As has been asked, attach your code (*.vi file) so that we can help you. at least an image but the vi is better...

0 Kudos
Message 5 of 8
(113 Views)

Hi all,

 

you may ask the OP for more information - or read the very same post on Reddit

 

(Another spammer.)

Best regards,
GerdW


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

Has someone asked a moderator to remove the account jet?

0 Kudos
Message 7 of 8
(59 Views)

Hi Wiebe,

 

I reported to the moderators instead of using "mark as SPAM" instantly.

There are valid comments on the initial question, so we might even let this thread stay…

Best regards,
GerdW


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