LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Possible bug: Local variable writeback ignored if it's too fast

Just ran into something odd when writing a console style interface.

 

The console takes a command (on the left hand string control), followed by an enter.  It gets a response from the top loop, and sends it via queue to the bottom loop.

 

In the bottom loop, the response is concatenated with the current value of the string control, and written back to the string control itself via a local... or at least, it should be.  Often, the write back to the string control local doesn't actually write to the control.

 

Enabling the disabled 10 ms delay in the lower loop allows the correct writeback to occur.  Alternatively, using a value property node rather than a local also works... though that may just be inducing enough delay for it to work.

 

Anyone able to confirm this one?

 

Thanks, Joe Z.

0 Kudos
Message 1 of 13
(2,962 Views)

Hi,

 

using LV8.6.1 looks fine:

Console_Bug_FP.png

Message Edited by GerdW on 07-23-2009 10:20 PM
Best regards,
GerdW


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

Look again.  The local variable for the control on the left and the string indicator on the right are being written in the same frame.  They should be identical after an entry.

 

Good idea on the minmax.

 

Joe Z.

0 Kudos
Message 4 of 13
(2,947 Views)

I think I see the differences you are talking about once I enable the 10msec wait.

 

I don't understand what you are doing though.  You enter data into the queue (which comes from a series of characters you just typed into the console window.).  Then you put the new data into a queue.  You dequeue that and take the control (which should have the new data already put into it, and append the new data to it).  Although it doesn't quite seem to be doing that.

 

What is your goal here?  Your methods seem a bit convoluted to me.

 

I would suspect a race condition.  Any time something behaves differently by putting in a wait statement, a race condition is the likely cause.  Using a property node is a bit slower than using a local variable, so perhaps that is why is works as well as putting in the wait statement.  You should try doing it with highlight execution turned on as well (though that is painfully slow).

Message Edited by Ravens Fan on 07-23-2009 04:40 PM
0 Kudos
Message 5 of 13
(2,936 Views)

It works on my PC without the delay

 

 Windows xp SP2

 

LabVIEW 8.6.1.f1

 

HP 8400 Workstation

Visualize the Solution

CLA

LabVIEW, LabVIEW FPGA
0 Kudos
Message 6 of 13
(2,930 Views)

Hi Joe,

 

now I got it...

I attached a possible workaround. As you already check for keypresses you can do that entirely on your own...

 

I also think of a (kind of) race condition because of your event structure used for filtering keypresses...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 13
(2,924 Views)
Put a Console Window.Key Focus = False in the frame before the write to local...
0 Kudos
Message 8 of 13
(2,921 Views)

Ravens Fan,

 

Good to hear from you again 🙂

 

The goal is to emulate the interface on programs like hyperterminal.  In the real program, there is a serial comm VI in the upper loop, rather than just feeding back a formatted string.

 

I'm open to reasonable suggestions for alternative implementations.

 

Joe Z.

0 Kudos
Message 9 of 13
(2,916 Views)

VADave,

 

Thanks!

 

RandyR,

 

Thanks, I noticed that as well.  Again, not sure if that is just allowing more time for the operation, or if it's something else.

 

Joe Z.

0 Kudos
Message 10 of 13
(2,900 Views)