07-12-2006 05:29 AM
Hi,
I wonder if anyone can help me with the problem.
An application we use in work requires the use of a 8 channel waveform chart. The X axis an be changed by the user to display any time from the current shift (it could be before the logging begins, or after the current sample). This part of the program is currently working correctly and we have had no problems with it.
The next bit gets a bit trickier so I will explain it as best as I can: -
We currently require paper copies of the waveform being displayed identical to the properties shown on the screen. This is done by calling a subVI and sending the waveforms, x.offset, xmaximum, x minimum and history. (Additional information is sent but that is separate to this chart)
the information seem to get transferred correctly until the buffer is full, or the x axis is adjusted. The whole aim for the print VI is to recreate the chart exactly how it is displayed on the screen.
I have attached the VI to give you an example of what I mean -
Potential1 is the main VI which produces the graph which we would like to print
Print multiple graph1/2/3/4 are examples of the current solutions we have attempted (solution 3 works better then 4 but still has issues once the buffer is full)
graph test- this is how we would ideally like the second graph to function.
Although I am new to LabView its seems to be very difficult to get graphs to display real-time data when you begin to manipulate the axis.
07-12-2006 06:34 AM
Hi Edster,
I haven't examined all your VIs in detail - but I'd like to ask a couple of questions...
Why are you creating a second graph/VI?
How are you "printing" the graph?
It's fairly easy to print a control image directly using "Report Generation" VIs - although the print scaling is sometimes distorted to fit the page size..
Mark.
07-12-2006 06:55 AM
A second graph is created to format the page to document template required here. If you look at the VI's you can see the page that is printed is a lot different to the one being displayed. This was how the system was originally designed - I have currently been tasked with trying to solve this problem.
The graph/chart layout is then sent to a default printer and the document is exaclty as it is displayed on the print multiple graph Vi.
I have looked at using the print report option, but I have a number of issues with it and think it will be quite difficult to get the same layout of document as required.
If you get a chance please have a look at the VI in particular print multiple graph 3.
07-12-2006 10:12 AM
Edster,
First of all - I had to tidy up some of your code. It was a bit messy and very difficult to read what was trying to be done. Even though I havn't solved the problem, you might find it useful to see the code laid out a bit clearer. I'm not sure why you used local variables to access inout values instead of just connecting to the wires/terminals.
Unfortunately the bad news is - as far as I can see, once the chart x-axis is scrolled away from showing the most recent data there is actually no way of determining the index into the history array from where the displayed data is taken. The "offset" is not an index into the history array, it's simply a modification the the charts original "zeroth x-value".
Sorry if this is bad news - I can't think of any work around to implement your basic idea.
Mark.
P.S. I've attached some tidied up code of yours.
07-13-2006 02:17 AM
Hi
Thank you very much for the reply, I thought my code was a bit messy - I had recently attempted a different solution, and kept some of the components to build up the this solution. By then I was slightly exasperated with the problem, as I would get it to scroll in one direction but would fall over when I attempted it in another.
I don’t quite understand why it wont allow the data to be moved, when they give you the option to do this in the chart command. Surely if you know the length of the history array, and the actual time that you started the graph you could work out where the sample should be displayed.
I want sure if the idea concept could be complete, but I will keep having I look at it - I have an idea in my head atm. Cheers for the info and the feedback, every little bit helps!!
Edster
07-13-2006 06:23 AM
07-13-2006 06:33 AM
Hi,
Sorry about that, I have attached the file as requested.
07-13-2006 10:20 AM
07-13-2006 10:47 AM
07-14-2006 02:19 AM
Hi Partha - The VI does print but I still have the issue with the actual information displayed on the graph.
Mark H - Attached is another attempy at a solution - apologies if the code is not very tidy (still getting the hang of the actual programming language). This program seems to allow you to move the data required, and print out the correct information. Would it be possible for you to have a look at it and comment as to whether you think this is a valid solution.
My only other point would be that if you know the start time for the logging, the length of the array, the max and minimum of the graph and the current time there must be a way of getting the graph to sidplay the correct information, although I current havent been able to programatically write one down I can sort of see the soultion in my head.