LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Inconsistent Duplicate Message Display

Solved!
Go to solution

Can someone see what I'm doing wrong in my code? I have two message windows MsgLog1 and MsgLog2.  MsgLog2 is a continuous running message.  MsgLog1 is a "copy" of MsgLog2.  No message in MsgLog1 should be displayed on the first run.  Only two consecutive messages of the same type (0 or 1) should be displayed with D/T stamped in MsgLog1.  However, sometimes I get two of the same message displayed in MsgLog1 with same D/T but sometimes not.   Using Labview 2012 (TestMssg 2012.zip).  Adjust the "millseconds wait" seemed to help but not consistent!

Download All
0 Kudos
Message 1 of 8
(3,214 Views)

Is the code I added to your VI more what you want?



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 8
(3,192 Views)

Thanks for your quick response sir!

What you modified is not quite what I had intended.  There's no event structure needed in my application as the boolean is actually a data bit of either '1' or '0'.  So I modified my original code with a simulated random '1' or '0' to generate the event.  The idea is, if two CONSECUTIVE '0' would technically be displayed on the MsgLog1 (the 3rd one will not) but the time-stamped should be different by at least 1-sec (see the correct.jpg file).  The incorrect display is shown in the Incorrect.jpg file.  I don't want to control the Wait milliseconds to be able to have this proper display in MsgLog1.  If they are identical messages, I don't want to display it a second time.  I updated the code V2 in LV2012 version.  thanks

Download All
0 Kudos
Message 3 of 8
(3,184 Views)
Solution
Accepted by stpC

Try this one. I took the liberty to clean the code up a bit.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 4 of 8
(3,174 Views)

Here's another version. You will have to put in your logic for counters, red font, etc, but it gets rid of duplicates.

 

mcduff

 

 

Message 5 of 8
(3,171 Views)

@mcduff wrote:

Here's another version. You will have to put in your logic for counters, red font, etc, but it gets rid of duplicates.

 

mcduff

 

 


I like your choice to compare the strings better than my choice to use time. However both gives the OP some examples of different ways to approach the problem.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 8
(3,169 Views)

I was impressed that you figured out the counter logic and the "matryoshka" cases structures.

 

mcduff

0 Kudos
Message 7 of 8
(3,167 Views)

The time comparison to ensure 1 sec in between message  as you had implemented worked best.  Your code is very clean and easy to read comparing to my original.  I also like mcduff's comparing strings approach.   In either case, Thank you much for your  advice and timely response.

0 Kudos
Message 8 of 8
(3,131 Views)