LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Running log on front panel

Solved!
Go to solution

I am thinking about creating a running log on the front panel of my VI.  It is bascially a string indicator.   Each time I write to it in my VI, the indicator will keep what is on there, and write on the next line.  To do this, I am thinking about using a shift register to preserve what is in the indicator and continue to append to it. 

 

Is that the best approach?

 

Yik

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
Message 1 of 13
(4,424 Views)

If you already have a Loop, then yes, it is a good approach.

 

The only reason I can't say best is that I didn't see your code.

 

Nevertheless, what you describe is a correct approach.

Message 2 of 13
(4,411 Views)

Is there an indicator out there that would keep what you write and append to what is already there when you write again? 

 

Yik

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 3 of 13
(4,392 Views)
Use a concatenate string inside a while loop and add a shift register to the loop. In the string control right click choose update while typing.
0 Kudos
Message 4 of 13
(4,377 Views)

shiftregister+string indicator

 

 

Regards
Guru (CLA)
0 Kudos
Message 5 of 13
(4,374 Views)

Hi Yik,

 

no. But you could make a XControl to hide the neccessary string concat and shift register (or feedback node)...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 13
(4,363 Views)
If you are really looking for a log. I would think about using a string array. Initialize the array to the Max size of the log that you want to keep and then just replace the array index every time through. It will make the code more efficient. This way you get a circular array for the log that never gets bigger than what you started with.
Tim
GHSP
0 Kudos
Message 7 of 13
(4,355 Views)

I have a set of VIs that implement a "Memory Log" so that when code runs they can log their actions. It's based on a queue with the element being a string. The queue is of a fixed size so that it does not grow out of bounds (in terms of the number of elements). There is a "Memory Log - Log Viewer" VI that has a string indicator to display the queue's contents. There's other tools on it, such as automatic scrolling to the bottom as new entries are added, clearing the log, searching the log entries for some text, and writing the entries to file.

 

No, I won't upload the code since it's company proprietary Smiley Wink , but it should give you an alternative idea. 

0 Kudos
Message 8 of 13
(4,346 Views)
Solution
Accepted by jyang72211

... since we are sharing ideas ...

 

I had implemented something similar to what SMercurio described, except that I used an ActionEngine.  This allowed me to keep a log from any of the sub-vi's simply by "dropping in" the ActionEngine.  It had additional features to enable / disable logging, select a file/folder, etc.  Worked great.

Message 9 of 13
(4,337 Views)

Ray.R wrote:

... since we are sharing ideas ...

 

I had implemented something similar to what SMercurio described, except that I used an ActionEngine.  This allowed me to keep a log from any of the sub-vi's simply by "dropping in" the ActionEngine.  It had additional features to enable / disable logging, select a file/folder, etc.  Worked great.


Well, the core of it is an Action Engine. Smiley Wink I just use wrapper VIs to perform certain functions. For example, there's a "Memory Log - Add Entry" VI that gets used by subVIs. That's just so I don't have to keep wiring the enum constant to specify what action to take. Gets tiresome after a while. 

0 Kudos
Message 10 of 13
(4,325 Views)