02-27-2010 10:26 PM
Hi,
I am using the "get image invoke method" in a subVI in in order to capture a chart waveform and save it to a jpeg image, the subVI receives a reference to the chart
the chart waveform has 2 superimposed plots, temperature and RSL Vs loop count as shown below, temperature is double , and RSL is double
I have tested my subVI on its own, and I know that it works fine on its own, when I embed it in my application that has other similar subVIs that capture chart waveforms,
the result I get is usually an Image with a blank chart, I look at the front panel object, and it is perfectly plotted as expected. why is there a difference ? I have had similiar random problems with capturing a front panel table image, at random sometimes it works and sometimes it doesnt.
what is wrong here ?
please see attachment for the function "updateRSLChartsForRBERClient.vi"
in summary this function does the following
1. read a CSV file,
2. take the last line of the CSV file
4. extracts values in this last line then adds 4 points to 2 charts
5. captures an image of the 2 charts
6. saves that image in a jpeg

I am using 8.2.1, but I recompiled in 8.5 and it does the same thing
any help would be greatly appreciated
thanks
JS
02-28-2010 02:19 AM
Hi JS,
did you see any error messages if you have no image from your chart? What do you mean with " the charts have identical references"? If you have only one FP element, then you can have only one refnum.
Mike
02-28-2010 09:50 AM
no error messages
identical references : from the block diagram, the "value property node" receives a reference to a chart (blue wire), and the "get image invoke method" also receives a referenceto a chart (blue wire)
both receive a reference to the same chart
thanks
JS
02-28-2010 09:51 AM
All of the typedefs are not included, so we can't run your code. I also don't understand why you're trying to use 2 different references for the same chart. The reference is for the control, not the individual plots. I don't know how you're calling this VI, but you should be aware that if the front panel is not visible then LabVIEW will not update the chart's UI in order for the image capture to be successul. This is by design. If the front panel is visible then I would suggest you pare down your example so it's manageable and others can try to reproduce the issue, if there is one.
Code comments:
02-28-2010 10:57 AM
thanks for the advice, I will use spreadsheet subVIs next time.
please note: I have 2 references for 2 charts, I am plotting 2 independant charts, and capturing the images of 2 independant charts
attached please find a version of the subVI without the FSM state cluster, this should be executable standalone.
thanks
JS
02-28-2010 02:23 PM
one more hint that might be helpful in getting to the root of this problem:
in my top level application, I get images of 6 charts in total using 3 subVIs that are similar to the problem subVI that I have here
the 1st subVI always produces the correct charts (1st 2 charts)
the 2nd and 3rd subVIs usually produce incorrect charts 2nd and 3rd pair of charts
all 3 subVIs are practically copy-paste except for minor modifications due to the differences between the data types being charted
1st 2 charts plot double and uint64 (temperature and block errors Vs time)
2nd 2charts plot double and double (temperature and received signal level Vs time)<-------- this is the subject of this thread
3rd 2 charts plot double and uint64 (temperature and packet loss Vs time)
03-02-2010 11:04 AM
Hi Joe,
Have you tried probing the Image Date wire from the invoke node to see what information is being passed to the Write jpeg File VI? Is there no information or is there data but it's not being recognized by the Write JPEG File VI?
03-02-2010 04:16 PM
Hi,
I have tried probing the Image data wire before in a similar application that has a similar problem to this (blank image) and the behaviour of the probe was as follows
run first time = you get image
run second time = black
run more time, at random sometime black sometimes the image
this is how I narrowed down my problem to the get image invoke method and not the jpeg write.
thanks
JS
03-02-2010 08:52 PM
Couple of thoughts that may help out...
Have you tried setting the Charts as Syncronous?
The updates may be getting applied to the first and the screen updates for the subsequent fight for the UI thread ...
There have been issues with chart updates on tab pages ....
Hiding and showing the graph sometimes helps. Defer FP updates to freeze the UI updates, hide the chart, show the chart, undefer FP updates*... then get image.
Can you demo this with a way dumbed down working version that demos the issue?
If so please post so we can poke at it.
Ben
* I call this "jiggling the handle" ![]()
03-02-2010 10:50 PM
I am using tabs, and the 6 charts are on three pages of a tab, 2 per page, I forgot to mention this detail
and this problem is like the fridge light every time I test the subVI on its own, it works perfect from both IDE and executable, it is just when I put it in my application that it works randomly. most of the time I get 2 images, coincidentally the 2 on the 1st page of the tab, sometime I get 4 images and rarely do I get all 6.
thanks for you response, I will find out what synchronous means, and will read up on it tommorrow, also FP updates, never heard of that either
is there any cure also for tables ? I have a similar problem with multiple tables on different pages of a tab.
I am going to make a simplified version tommorrow complete with the tab and see if I can post it
thank you all for your help
regards
JS