LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Screen Dump doesn't always work

I have put code into my app for screen dump of the front panel.  Problem is, sometimes it works, sometimes it doesn't work.  The Path indicates correction on the front panel, but checking the destination finds nothing.  Here is my code.  Also, Y directory is on a remote server that i make sure is communicating before I attempt to save a screen.

0 Kudos
Message 1 of 18
(2,782 Views)

Hi Cory,

 

- building a path using ConcatString is always dangerous. Use BuildPath instead!

- to correctly format a timestamp I prefer FormatIntoString (or FormatDateTimeString)! No need to search&replace some chars!

- why do you create a BMP? Why not use PNG instead?

- it would help to attach a snippet instead of a plain image. It would help to autocleanup before uploading…

- there is no error handling in your image: do you get any errors at the BMP file function?

 

Like this:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 18
(2,780 Views)

I can't find the vi that you are using to tie the 'Get Time and Data' vi ' to.  You are using it to append the job number, file name etc to the Path build.  I can't find it.

Ron

0 Kudos
Message 3 of 18
(2,751 Views)

Hi Cory,

 

I named it in my message: FormatIntoString…

 

Btw. I embedded a snippet in my last message. You should look up those "snippets" in the LabVIEW help!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 18
(2,747 Views)

I coded the screen dump exactly as yours with the exception of not finding that one vi, so I used the format time vi and that worked fine.  The problem is that it is usually the very first time I try to save a screen it doesn't work, but then it works every time after that.  Any reason for this?  Also, the was my original save was coded, works for all of my data saves since 2005.  It's the screen dump that has always given me issues.  I will see if it has something to do with saving to the remote server.  I'll set up a folder on my local machine and try that.

 

0 Kudos
Message 5 of 18
(2,743 Views)

Hi Cory,

 

I will see if it has something to do with saving to the remote server.

Is that network drive set to "bind late"? That would explain problems with first save attempt as the drive needs to be "initialized" by the OS, which may take too long!

But then you should get an error message from WriteBMP - but you failed to implement error handling…

 

exactly as yours with the exception of not finding that one vi,

I named that function twice: FormatIntoString (for the 3rd time)…

Can't you use that snippet?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 18
(2,728 Views)

FYI, when using snippets on the forum:

 

You can't just "right-click --> save" to use snippets!

 

In order to use the snippet, you have to click the picture, and then click the small, unlabeled "download image" button.

 

If you right-click and save, you get a 7 kb file.  If you use the "download image" button, it's a 17 kb file.  That missing 10 kb is the metadata allowing you to drag the .png file from explorer onto a block diagram and have it put down real functions instead of a picture.

 

Since this is strange, it's not at all surprising that new forum members (or even experienced ones...) find it non-intuitive.

0 Kudos
Message 7 of 18
(2,718 Views)

@Kyle97330 wrote:

FYI, when using snippets on the forum:

 

You can't just "right-click --> save" to use snippets!

 

In order to use the snippet, you have to click the picture, and then click the small, unlabeled "download image" button.

 

If you right-click and save, you get a 7 kb file.  If you use the "download image" button, it's a 17 kb file.  That missing 10 kb is the metadata allowing you to drag the .png file from explorer onto a block diagram and have it put down real functions instead of a picture.

 

Since this is strange, it's not at all surprising that new forum members (or even experienced ones...) find it non-intuitive.


...especially when you used to be able to right-click and save.  One of the awesome upgrades to the forum was to display a processed image.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 18
(2,710 Views)

Hi,

 

about those quirks with snippets in the forum:

I hope/guess Cory way able to read Lili's announcement on "snippets" as it's just one of two pinned threads just as first entry in the thread list…

 

(I always tend to recommend to read any help/manual before starting to ask questions. There's a four-letter-acronym for such situations, but some people blamed me on using that too often. :D)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 18
(2,699 Views)

OK.  I used the tip and successfully downloaded the snippet.  I also had the correct subvi.  I didn't realize the input connection changed to a small hour glass the second you connect the 'GetTime' subvi.  Now, what the heck do I do with the snippet?  I pasted it into my existing vi, but there it sits.  Am I supposed to paste it into a new vi and then try it?  Anyway, I connected an error subvi to my code and learned I get an Error 7 the first time I try to save the screen.  I continued to get the same error with several save attempts.  Then, I went to the folder on the server to see if there was anything there.  There wasn't.  I went back to my app and BINGO!  The save worked!   So, it's like my app doesn't know that location exists until I go there in explorer and them come back to my app.  Why is that?

0 Kudos
Message 10 of 18
(2,692 Views)