Exporting PXI_Trig on PFI line

Seems like this should be straight forwarded, but I have yet to see any results.  Specifically I want to map the PXI_Trig0 line to a PFI line for output, but I have yet to capture an actual trigger pulse and just read 0V the entire time.  My code is attached.
My specific goal is that I want to see the XNET "starttrigger" in my collected AI DAQ task.  The DAQ task has to be started prior the XNET task, so this event gives me away to corelate the data.  My approach to pass the data is as follows.
1.)  Connect XNET starttrigger to PXI_Trig0  (Unfortunetly there are no external trigger lines on the XNET device)
2.)  Connect PXI_Trig0 to PFI0
3.)  Physically wire PFI0 zero to AI.
I am not getting any errors or warnings, just no visible trigger pulse on my AI.  Hardware in use is a PXI-6229
Attachments:
timetest4.vi ‏49 KB

After a bit more testing it appears this may have more to do with XNET than LabVIEW.  I've attached two pieces of code.  One triggers XNET off a DAQ task, this works.  The other triggers DAQ off an XNET task, this does not work.  Both export the PXI_trig on a PFI line, which appears to work and is read by an AI task correctly after physically wired.
The DAQ generated trigger appears to output a trigger value of 5V when the task is stopped and 0V when running.
The XNET generated trigger, drops from 5V to 0V as soon as the mapping happens, does not respond to the task starting and stoping and then goes back to 5V only after the task is cleared.  This behavior also incorrectly causes the DAQ task to start before the XNET task.
After looking for examples, I can not seem to find any examples the do the later.  They all seem to trigger XNET off of a DAQ task.
Attachments:
SyncDAQ2XNET.vi ‏51 KB
SyncXNET2DAQ.vi ‏53 KB

Similar Messages

  • How Do I Configure the PFI Lines as input in PXI 6713 module

    Hi,
    I have PXI 6713 module in my PXI 1044 chassis. I have configured PXI 6713 module to geneate certain analogue signals to my board.
    Board inturn process this analogue signal and responds back the status signals through a status register on the board. In my application,the status bits in status register of  the board are mapped to the PFI 0:3 bits on PXI 6713 module ( pins 11,10 , 42 and 43).
    My query is how do i configue the PFI lines as input in PXI 6713 module to read these status bits ??
    May be below explanation could give you little bit more information w.r.to my query.
    When i use NI USB - 6008    module to read the same bits , since this device has 12 digital I/O lines, i could able to read the status bits in to the last 4 digital lines by configuring the those digital lines as input.
    In PXI 6713  module i have only 8 digital lines. These 8 digital lines i have used to send the digital signals to the board. I am left with no digital I/O lines. Hence i couldn't use these digital lines. I am left with only one option to use. Theya re PFI lines. Moreover the status bits in the pin out of board are mapped such that the bits can be read through the PFI lines.
    I am wondering do we have any example code to use  inorder to read these status bits on the board using the PFI lines.
    Please let me know if you need additional information to help me out.
    Thanks.
    Solved!
    Go to Solution.

    Hello There,
    When using the PFI pin as an input, you can individually configure each PFI for edge or level detection and for polarity selection.  This PFI information can be referenced in the DAQ Analog Output Series Manual on page 6-1 (http://www.ni.com/pdf/manuals/370735e.pdf).  Unfortunately, the PXI-6713 PFI lines are only capable of timing input and output signal for AI, AO, or counter/timer functions.  The option of creating static DI from the PFI lines is not available for the PXI-6713. However, some cards have this capability.  Newer National Instruments products with PFI lines have the option of setting PFI lines as:
    Static Digital Input 
    Static Digital Output
    Timing Input Signal for AI, AO, DI, DO, or counter/timer functions 
    Timing Output Signal from AI, AO, DI, DO, or counter/timer functions
    (http://digital.ni.com/public.nsf/allkb/14F20D79C649F8CD86256FBE005C2BC4)
    When set as static DIO, the PFI lines are assigned to a different port (eg. PFI0-7 is Port1).  More details about this can be referenced at:
    http://digital.ni.com/public.nsf/allkb/DA2D3CD0B8E8EE2A8625752F007596E1
    http://digital.ni.com/public.nsf/allkb/862567530005F09E8625677800577C27
    Regards,
    Roman Sandoval | National Instruments | RF Systems Engineer

  • How to output sample and convert clocks to PFI lines of E-Series DAQ (DAQPad-60​15)

    Hi,
    Can someone tell me how to output sample and convert clocks to PFI lines of E-Series DAQ (DAQPad-6015)?
    Thank you very much.
    Jack

    John --
    Windows is not an option for me. I like your idea of using a counter output -- it may be helpful as I am getting ramped up, but my application will eventually require both timer outputs.
    I have a legacy C application written for Macintosh, and I am in the process of moving it onto OS X. So my options are to use DAQmx Base, or write an in-kernel driver. I actually have already done the latter for 6024/6025 E-series boards (for another company); for this client I was hoping to use the DAQmx Base to allow an easy transition to M-series boards, without the cost of writing and supporting a low-level driver.
    The specific task I am doing is relatively straightforward. I record 2 channels of AI for a short period (usually about 250 ms.) and during this time I drive 2 external digital signals. Right now, I use the 2 timer outputs, which allows precise synchronization with the output and AI sampling.
    I appreciate your comments, and thanks in advance for any additional suggestions you can lob my way.
    --spg
    Scott Gillespie
    Applied Brain, Inc.
    scott gillespie
    applied brain, inc.

  • Driving DO lines with external clock wired to PFI lines

    Hi all,
    I have few issues understanding how to use hardware timing resources in M series USB6229, with particular focus on DO. I have read last couple of day all google offered on the subject but I am still straggling with some basic tasks. To cut the story short, the 1e6 dollar question:  can I set up 7 independent DO lines where (different tasks or virtual channels) where lines use same hardware timing source (eg, freqout or CO0 set to ~10kHz sampling time routed to PFI0).
    Note: the reason I need 7 independent lines and not a port output (which would be obvious solution) is because I need to have (vastly) different number of samples and for each line.
    Follow up question regarding timing: As I understood, any of PFI ports could be used and a input to the external clock which could be used to drive DO line(s) samples. I have tried to generate one DO, eg. P0\line4 by using CO0 to generate 10kHz sample rate.  The signal on the line4 is pulse with frequency of few Hz which I routed to PF6 (with actual wire) in hope to use this signal as a clock for line5. I tried this but I am receiving errors about "resources in use"
    Possible reason(s):
    Specified route cannot be satisfied, because it requires resources that are currently in use by another route.
    Property: SampClk.Src
    Property: SampClk.ActiveEdge
    Source Device: USB-6229
    Source Terminal: PFI6
    Required Resources in Use by
    Task Name: _unnamedTask<7B>
    Source Device: USB-6229
    Source Terminal: PFI4
    Destination Device: USB-6229
    Destination Terminal: do/SampleClock
    Task Name: _unnamedTask<79>
     Apparently, many of internal clocks are routed internally to different PFI lines which mean the lines are occupied resource, and I do not know how to solve this.
    I wanted to ask you does this principle sound as something that should work and if you know about some examples that would be excellent.   
    Any help would be greatly appreciated.
    Cheers, Nenad

    > To cut the story short, the 1e6 dollar question:  can I set up 7 independent DO lines where (different tasks or virtual channels) where lines use same hardware timing source (eg, freqout or CO0 set to ~10kHz sampling time routed to PFI0).
    No, you can't. The USB-6229 has a single digital output FIFO which can only be used by one task at a time.
    > Note: the reason I need 7 independent lines and not a port output (which would be obvious solution) is because I need to have (vastly) different number of samples and for each line.
    It should be possible to generate all seven signals with a single task by generating a waveform that includes all seven signals. If the signals repeat at different rates or you need to start/stop them independently, you will have to disable regeneration and continuously generate new waveform segments on the fly. Continuous Write Digital Port - External Clock - Non Regeneration should be a good starting point for the DAQmx programming, but actually generating the data is likely to be the challenging part.
    Brad
    Brad Keryan
    NI R&D

  • Export or Print different line weights (like in AutoCAD)

    Is there a way to Export / Print / Save As artwork with reduced line weights like you can in AutoCAD? i.e. Export a PDF and all line thickness is reduced by 50%
    I have a map project that I'm working on and I want to export different sections of the map at different scales (different zoom levels) which when you export a PDF, displays line thickess differently for each level of zoom. I'd like to have it setup similar to AutoCAD where I can create a window and now matter what level of zoom, the lines are exported at the same thickness (I'd use Artboards as export windows)
    Sorry if this is confusing!  Is there a Plug-In or another way to do this without physically changing the line weights?

    Do you want a PDF that displays different line weights depending on zoom level? Not possible. Or do you want to export a PDF with line weights different from the ones in your Illustrator file? Possible, even recordable as an action.
    Once the artwork is selected, go to Object > Transform > Scale. Scale to 50% and turn on Scale Strokes & Effects, then click OK. Repeat, this time with scaling set to 200% and turn off Scale Strokes & Effects. Save or Save a Copy, then undo twice.
    Here it is an an action: http://dl.dropbox.com/u/5005292/Set_1.aia

  • Output pulse with NI-Scope only, on 5102 PFI line

    The NI-Scope documentation briefly mentions a "Configure Digital Output" function, but it is not clear exactly what this does, and what parameters are available (e.g., pulse width, polarity, stand-off, etc...), or if it merely "configures", and another function is needed to actually generate the pulse.
    Programming in VB, with NI-Scope, for the 5102, what NI-Scope function(s) would I call to initiate an output pulse on a PFI line? What parameters of the pulse can be controlled?
    Thank you, Ed More

    Hello Ed,
    You need to use functions in NI-DAQ in either LabVIEW or ComponentWorks to do this. There are some examples and a knowlegdebase article that describe this.
    Here are the links:
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/fead136291ec002186256aaa006c2019?OpenDocument
    http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3DFC756A4E034080020E74861&p_node=175381&p_source=external
    http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3DD5756A4E034080020E74861&p_node=175341&p_submitted=N&p_rank=&p_answer=&p_source=External
    If the links do not work, go to developer zone and search on 5102 and pfi to find the examples and go to support and search in knowledgebase on 5102 and pfi for t
    he knowledge base entry.
    -Brian

  • Question about DAQ PFI lines

    Hi , I would like to use 6363 OEM PFI lines to countiously count the number of rising edges of a digital signal. My signal is connected to PFI2 line . I would also like to output a pulse to provide external clock for this signal
    Here are the input output pins configuration. Could you please let me know which lines can I use for counter in and which lines for outputing a pulse. Can I also use PFI 2 for counter inpout?
    thanks 
    CTR 0 SRC PFI 8
    CTR 0 GATE PFI 9
    CTR 0 AUX PFI 10
    CTR 0 OUT PFI 12
    CTR 0 A PFI 8
    CTR 0 Z PFI 9
    CTR 0 B PFI 10
    CTR 1 SRC PFI 3
    CTR 1 GATE PFI 4
    CTR 1 AUX PFI 11
    CTR 1 OUT PFI 13
    CTR 1 A PFI 3
    CTR 1 Z PFI 4
    CTR 1 B PFI 11
    CTR 2 SRC PFI 0
    CTR 2 GATE PFI 1
    CTR 2 AUX PFI 2
    CTR 2 OUT PFI 14
    CTR 2 A PFI 0
    CTR 2 Z PFI 1
    CTR 2 B PFI 2
    CTR 3 SRC PFI 5
    CTR 3 GATE PFI 6
    CTR 3 AUX PFI 7
    CTR 3 OUT PFI 15
    CTR 3 A PFI 5
    CTR 3 Z PFI 6
    CTR 3 B PFI 7
    FREQ OUT PFI 14

    Hi,
    the following information should answer your question:
    X Series devices have up to 16 PFI lines.  Each PFI can be individually configured as the following:
    Static Digital Input
    Static Digital Output
    Timing Input Signal for AI, AO, DI, DO, or counter/timer functions
    Timing Output Signal from AI, AO, DI, DO, or counter/timer functions
    Each PFI can be individually configured as a static digital input or a static digital output. When a terminal is used as a static digital input or output, it is called P1.x or P2.x. On the I/O connector, each terminal is labeled PFI x/P1.x or PFI x/P2.x. The voltage input and output levels and the current drive levels of the PFI signals are listed in the specifications of your device.
    Also, PFI can be configured to detect digital changes. The values on the PFI lines cannot be read in a hardware-timed task, but they can be used to fire the change detection event. For example, if you wanted to do change detection on eight timed DIO lines but wanted to ensure that the value of
    the lines was updated every second independent of the eight lines changing you could set a PFI line up for change detection and connect a 1 Hz signal to it.
    You can enable a programmable debouncing filter on each PFI, RTSI, PXI_STAR, or PXIe-DSTAR<A, B> signal. When the filters are enabled, your device samples the input on each rising edge of a filter clock. X Series devices use an onboard oscillator to generate the filter clock.
    Regards,
    Michael

  • Export Configuration via Command Line?

    Hi Gurus,
    Is it possible to do a configuration export via the command line? I have yet to find any documentation regarding this. The reason I ask is my GUI is having issues where I cannot save reports or export files. I have an SR open regarding the reports but not the export as this was noticed after the SR was created.
    Thanks
    Gerald

    Hi Gerald,
    Yes it is very much possible. For large configurations, it is recommended to take export from command line-
    1. run setenv file
    2. java -Xms512M -Xmx512M oracle.tip.repos.export.Export -inputfile <inputfile> [-ignoretypes <
    file>] <export file name>
    Arguments:
    -inputfile <inputfile> to export specific objects .
    -ignoretypes <file> , This is only for business process. This is to ignore
    the object types while exporting deployable BP.
    <export file name> name of the export file
    For e.g. -
    C:\B2B10g\Midtier\ip\install>java -Xms512M -Xmx512M oracle.tip.repos.export.Export C:\commandExport.xml
    Starting Execution Context
    Export file name is C:\commandExport.xml
    3.26
    exporting all design objects
    export done
    For benefit of other users of this community, I have documented the same on below link -
    http://anuj-dwivedi.blogspot.com/2009/12/exporting-configuration-through-command.html
    Regards,
    Anuj
    Edited by: Anuj Dwivedi, Infosys on Dec 22, 2009 10:28 PM

  • Export more than 74000 lines from SAP

    Dear Sirs,
    I have MS Office 2010 and try to export more than 74000 lines but the system didn't allow me. I have following user settings:
    Parameter ID
    AVE
    FBA
    FBZ
    FCJ
    FIT_ALV_AP
    FIT_ALV_GL
    FO2
    FO3
    FOP
    FZ1
    FZ2
    FZ5
    KME
    WLC
    GRWE
    G_RW_DOCUMENT_TYPE
    EXP
    Our SAp is 6.0.
    Thanks in advance.
    Dani

    Hi,
    upto my knowledge we can export only 999 lines . I am not quite sure
    raise a OSS message with SAP and check.
    G.Ganesh Kumar

  • Configuring a PFI Line in Traditional NIDAQ

    Hi - I'm using traditional NIDAQ (v 7.0) with a PCI-6711 card; I'm trying
    to connect an external clock signal to the analog output timebase signal
    (i.e. to the UISOURCE signal, as it's called in the DAQ manual). I'm
    having trouble with the following:
    I'm using the PFI-7 line to bring in the external clock signal,
    and in the manual (p. 4-13) it specifically says that the PFI line used
    for this purpose should be configured in the level-detection mode.
    What I would like to find out is how to do this configuration (specifically).
    I looked at the documentation for the Select_Signal() command, but that
    didn't look right, and I can't find anymore info on how to configure
    PFI lines (in general) in the level-detxn mode (nor for the edge-detxn
    mode, for that matter).
    Any advice/comments are appreciated. Regards,
    ARB

    Thank you for contacting National Instruments.  I believe that Select_Signal is the command that you are looking for.   You will want it to look something like this:
    Select_Signal(devicenumber,ND_OUT_UPDATE_CLOCK_TIMEBASE,ND_PFI_0,ND_LOW_TO_HIGH OR ND_HIGH_TO_LOW)
    where devicenumber is the actual device number and the ND_LOW_TO_HIGH OR ND_HIGH_TO_LOW parameter will be one or the other.  You can read more about this by looking at the Select_Signal in the Traditional NI-DAQ help.  The Signal Name Equivalenices Table tells you that the UISource is called by the name ND_OUT_UPDATE_CLOCK_TIMEBASE.  Then, you can read into the parameters for this by clicking on the link that says:
    "Parameter Discussion for E Series, I Series, 671X, 673X, NI 5411, and DSA Devices"
    Then, click on the ND_OUT_UPDATE_CLOCK_TIMEBASE link in the table.  This will give you the possible parameter values for the source and sourcespec parameters.
    Hope this is helpful!
    Jeff P.
    National Instruments Applications Engineer
    Jeffrey P.
    LabVIEW Product Management
    National Instruments

  • M-Series PFI lines allotment

    Is it possible to allocate a digital signal to each PFI line individually for counter 0/1?
    I mean, e.g., default counter/timer pinout for CTR 0 GATE is PFI 9.
    Now, I would like to configurate this terminal to an other PFI line (e.g. PFI 5).
    Can I do this with LabVIEW?
    I use NI PCI-6229 with LabVIEW 8.0
    thanks for answers

    Since this is a frequency measurement task, you'll want to change the frequency input terminal using the channel property node as shown in the attachment.
    Channel Property Node >> Counter Input >> Frequency >> Input Terminal
    gus....
    Attachments:
    frequencyinputterminal.jpg ‏26 KB

  • Error while exporting Report by Command Line.

    Hi,
    When I tried exporting few objects in BI Publisher from command line, I got follwoing message, whithout file being transfered: Any pointers?
    BIPublisher error:
    [export] Connect to http://ServerName:9704/xmlpserver/ using weblogic
    [export] Export E:\OBIEE11g_Middleware_Home\instances\instance1\bifoundationOracleBIPresentationServicesComponent\coreapplication_obips1\catalog\Oneview-R to E:\OBIEE11g_Middleware_Home\Oracle_BI1\clients\bipublisher\BIPCatalogUtil\bin\Oneview-Rz
    Command Error: export->exportObject
    oracle.xdo.webservice.exception.OperationFailedException: PublicReportService::executeDownloadReport Failure: Unable to download Report for [E:\OBIEE11g_Midd
    leware_Home\instances\instance1\bifoundationOracleBIPresentationServicesComponen
    t\coreapplication_obips1\catalog\Oneview-R] Due to unable to find ReportObject
    Done.
    The system cannot find the path specified.
    Regards,
    Jitendra

    To find out what version of Eclipse you have, open the .eclipseproduct file.
    To find out what version of the JRC you are on, you can look at the <eclipse home>\plugins\com.businessobjects.sdks.jrc.11.8.x to see what your latest version is.
    This stack trace on it's own doesn't indicate why you are having a problem.  It could be a problem with something in the report.... or it could be something wrong in the code.  To ensure your code is correct, you should verify it against the sample code in the Developer Library and the JRC sample downloads.
    Does the file get exported even though you have the error or is there no file or a zero byte file?

  • Slideshow exported to pdf: jagged lines

    Although this issue has been brought up before in this forum, it has never been properly answered or resolved. Therefore, I will be pretty precise about the procedure in the hope that knowledgeable people will take a closer look at the issue.
    For test purposes on this forum, I make a "slideshow" in LR 2.1 MacBook Pro using one single 10Mpx RAW image that has been pre-rendered 1:1 in Library. For this demonstration, the slideshow has no borders, no text, and 0 pixel margins in layout.
    First, I play the slideshow i LR 2.1 so it shows full screen on my 1920x1200 SpectraView monitor, then, to make you see the result, I do a screen shot and then crop the relevant detail from the image, then 'Save for web' jpg to make it web friendly so you can easily see it.
    The following image is the relevant detail of the full-screen LR image, namely a car (a very nice beautiful good-looking car, since it happens to be MY car:-)
    (http://tmp.bragit.com/slideLR.jpg)
    Then, in LR 2.1, I export to pdf, choosing Screen as resolution, which in my case is 1920x1200, at 100% quality, 'automatically show full screen'. Then I open the pdf in Acrobat 8.1.2, which shows it in full screen on my 1920x1200 monitor. Since the monitor matches the chosen resolution, the result SHOULD be at least as good as the way LR "plays" the slideshow, but preferably with some suitable amount of output sharpening.
    However, the car in the image now has very ugly jagged lines. To make you see the result, I do again a screen shot and then crop the relevant detail from the image, then 'Save for web' jpg to make it web friendly so you can easily see it. (This jpg sRGB procedure has not affected the visual result of the artifacts in any relevant way.)
    The following image is the relevant detail of the pdf-exported full-screen image, namely the car:
    (http://tmp.bragit.com/slidePDF.jpg)
    It should be pretty obvious that the result is unacceptable. It is not primarily sharpening that causes the jagged behavior, it looks more like a very bad resampling. Many people seem to have reported the same thing, so I wonder how come this hasn't been addressed at all in the last few versions of LR? Or do you really have a workaround?
    PS: increasing resolution further (to for instance 3000x2000 pixels) on export does NOT solve the problem; it only makes the artifact somewhat smaller.

    As to why I export pdf slideshows: there are three reasons and usages for this:
    1. Making relatively small (eg. 900x1440) slideshows to be sent over email to people. For about a year I have noticed the quality is lousy, but I first thought it was because LR did a much too strong sharpening on export, but much later I came to realize that the problem has a much more severe origin. I took for granted that Adobe was trying to do something about it, but obviously not.
    2. I can merge several pdf slideshows into one slideshow, so that I can have an Intro Screen at the start of each new "event", where each "event" may be only a few slides.
    3. The native quality of slideshows as shown by LightRoom is lousy in deep shadows, just as bad as in the Library module, despite it has been rendered 1:1. It is ONLY in the Develop module that shadows are rendered decently, or on export to jpg, or export to a pdf slideshow (but the latter has other problems as I have shown above). So, to make the shadows better, and to avoid various problems with the Slideshow module (such as starting or stopping on the wrong image), I often export to pdf. In addition, color management can behave differently when displaying the show on a separate monitor or projector, where LR and Acrobat sometimes differ, especially on Plasma screens.
    I have discussed the issue of bad shadow rendering before in this forum (long ago), and Jao thought it was due to a corrupt monitor profile, or at least an improper rendering intent, but I don't think so, and I showed screen shots so that everyone could see the effect. Some people only saw an almost black image, but that is because their monitor is bad. I have a very good monitor (SpectraView) that shows almost the entire Adobe RGB, and the profiling makes me able to see colors all the way down into the deepest shadows. Whenever color management is not working as it should, I see that immediately. It is in those shadows that the Library and Slideshow modules do a very bad job. Maybe the reason is that the previews are based on jpg, and jpg itself is extremely bad in shadows, usually causing severe posterizations.

  • Exporting from a 2D line graph with .jpeg extension

    Is there any way to export from an ordinary 2D line graph with .jpeg extension so that with using this image i will improve my result of exporting excel.
    e.g. i have found and example and added a button as you will see when you run this code.I will click this button and it will export this line graph with extension .jpeg so that i will see it as an ordinary image at my home directory.
    Thanks for any helpful comment
    Regars,
    Serhat
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    * @author led1433
    import java.awt.*;
    import java.awt.font.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class LineGraph
        public static void main(String[] args)
            int x1 = 1000,y1 = 0;
            JFrame f = new JFrame();
            JButton exportToJPegButton = new JButton("EXPORT WITH JPEG");
            exportToJPegButton.setToolTipText("Exports Graph with extension *jpeg");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            exportToJPegButton.setSize(200,25);
            f.add(exportToJPegButton).setLocation(x1, y1);
            f.getContentPane().add(new GraphPanel());
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class GraphPanel extends JPanel
        final int
            HPAD = 60,
            VPAD = 40;
        int[] data;
        Font font;
        public GraphPanel()
            data = new int[] {
                120, 190, 211, 75, 30, 290, 182, 65, 85, 120, 100, 101
            font = new Font("lucida sans regular", Font.PLAIN, 16);
            setBackground(Color.white);
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setFont(font);
            FontRenderContext frc = g2.getFontRenderContext();
            int w = getWidth();
            int h = getHeight();
            // scales
            float xInc = (w - HPAD - VPAD) / 11f;
            float yInc = (h - 2*VPAD) / 10f;
            int[] dataVals = getDataVals();
            float yScale = dataVals[2] / 10f;
            // ordinate
            g2.draw(new Line2D.Double(HPAD, VPAD, HPAD, h - VPAD));
            // tic marks
            float x1 = HPAD, y1 = VPAD, x2 = HPAD - 3, y2;
            for(int j = 0; j < 10; j++)
                g2.draw(new Line2D.Double(x1, y1, x2, y1));
                y1 += yInc;
            // labels
            String text; LineMetrics lm;
            float xs, ys, textWidth, height;
            for(int j = 0; j <= 10; j++)
                text = String.valueOf(dataVals[1] - (int)(j * yScale));
                textWidth = (float)font.getStringBounds(text, frc).getWidth();
                lm = font.getLineMetrics(text, frc);
                height = lm.getAscent();
                xs = HPAD - textWidth - 7;
                ys = VPAD + (j * yInc) + height/2;
                g2.drawString(text, xs, ys);
            // abcissa
            g2.draw(new Line2D.Double(HPAD, h - VPAD, w - VPAD, h - VPAD));
            // tic marks
            x1 = HPAD; y1 = h - VPAD; y2 = y1 + 3;
            for(int j = 0; j < 12; j++)
                g2.draw(new Line2D.Double(x1, y1, x1, y2));
                x1 += xInc;
            // labels
            ys = h - VPAD;
            for(int j = 0; j < 12; j++)
                text = String.valueOf(j + 1);
                textWidth = (float)font.getStringBounds(text, frc).getWidth();
                lm = font.getLineMetrics(text, frc);
                height = lm.getHeight();
                xs = HPAD + j * xInc - textWidth/2;
                g2.drawString(text, xs, ys + height);
            // plot data
            x1 = HPAD;
            yScale = (float)(h - 2*VPAD) / dataVals[2];
            for(int j = 0; j < data.length; j++)
                y1 = VPAD + (h - 2*VPAD) - (data[j] - dataVals[0]) * yScale;
                if(j > 0)
                    g2.draw(new Line2D.Double(x1, y1, x2, y2));
                x2 = x1;
                y2 = y1;
                x1 += xInc;
        private int[] getDataVals()
            int max = Integer.MIN_VALUE;
            int min = Integer.MAX_VALUE;
            for(int j = 0; j < data.length; j++)
                if(data[j] < min)
                    min = data[j];
                if(data[j] > max)
                    max = data[j];
            int span = max - min;
            return new int[] { min, max, span };
    }

    GraphPanel stays the same.
    public class JpegExport {
        public static void main(String[] args) {
            final GraphPanel graphPanel = new GraphPanel();
            JButton exportToJPegButton = new JButton("EXPORT WITH JPEG");
            exportToJPegButton.setToolTipText("Exports Graph with extension *jpeg");
            exportToJPegButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    exportToJpeg(graphPanel);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(exportToJPegButton, BorderLayout.NORTH);
            f.getContentPane().add(graphPanel, BorderLayout.CENTER);
            f.setSize(400, 400);
            f.setLocationRelativeTo(null);
            f.setVisible(true);
        private static void exportToJpeg(GraphPanel graphPanel) {
            try {
                int w = graphPanel.getWidth();
                int h = graphPanel.getHeight();
                BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
                Graphics2D g2 = image.createGraphics();
                graphPanel.paint(g2);
                g2.dispose();
                ImageIO.write(image, "jpeg", new File("export.jpg"));
            } catch (IOException e) {
                e.printStackTrace();
    }

  • PDF exports look terrible - white lines in text

    I have been u sing indesign for years and years all of the sudden my pdf exports look terrible. The images are pixelated and the text has white lines
    in it.
    I used these pdf previews for my clients and I certainly cant use what Im getting from INDD right now. I have no idea what happened to cuase this.
    Wish I could show you but any ideas would be great.
    The following text has no formatting on it yet there are pixelated white lines? help?
    Thanks in advance.

    Wow - thank you for all the responses. Yes it still happened with different fonts, different sizes of font etc... So I looked at my export settings and noticed that it was set to High Quality Print - Modified. I Switched it back to High Quality Print and it appear to have cleaned it up quite a bit.
    Thank you all for your speedy responses.

Maybe you are looking for

  • Error during the configuration wizard

    I am installing the PI 7.1 ehp1 on AIX/Oracle. While executing the configuration wizard, the following error occurs. How to resolve this error? Any information would be appreciated. Error: The configuration wizard attempted to execute synchronizeSLDA

  • Iphoto says my library has become unreadable

    i was importing and editing pictures tonight, and all of a sudden my library won't open and I get a screen that says my library is in use  by another application, or has become unreadable. i tried shutting down and restarting, and restarting pressing

  • How do I hang up on a conference call

    Need Help Here! How do I hang up on a conference 3-way call without completly diconnct the call?

  • Cannot find javax.ejb.CreateException fix classpath

    Hi Guys, I have made a Webdynpro in which I am using an EJB in the libraries of the project. When I access the classes of EJB I am getting a complie time error saying Cannot find class file for javax.ejb.CreateException. Fix the classpath then try re

  • Sublinks within a page - i.e .back to top

    anyone know how to link to text further down on same page and have a "back to top" link at bottom of page? I know this is very simple, but can't seem to figure it out in iWEb '09. Thanks thanks!!