Compiler Code Generation API

I would like to ask if you guys could make a Compiler Code Generation API.  This would allow developers who would like to fine-tune details you guys probably don't have time to do, for projects we think its important on.  Specifically with [Bindable] and {} code generation.
I would like to be able, and many others I'm sure, to turn Binding on/off (conditional binding), and add more complicated expressions, but that's currently impossible, unless I rewrote the core UIComponent and everything.  Or unless I had access to the generated code through a nice API which shouldn't take you guys long at all: you already are generating lots of code and have templates for it, I would just like to ask for easy access to those templates.
Please let me know what you think.  Thanks a lot for your time.
Lance

It's something we've thought about but it's not a high enough priority right now.  Certainly a feature that folks could think about implementing on their own and contributing back though.  It tends to be more complicated than you'd think though
Matt

Similar Messages

  • Error during distribution for compiled code generation-Reply

    Hi,
    Looking at your error messages, it looks as though your build is failing during the code generation phase of an autocompilation. To determine why the code generator crashed, either look in the $FORTE_ROOT/log/forte_ex*.log files or don't use autocompilation and use fcompile.
    There are many reasons why the code generator could crash. Some of the things I've come across are running out of memory and trying to find invalid classes.
    If its the invalid class problem you'll find a message like:
    Generating code for partition BLTCustomWindow_cl0_Part1.
    ERROR: Exiting due to following exception:
    SYSTEM ERROR: Client partition FTCompile_cl0_Client was terminated by escaped
    exception. See the remainder of the error stack for more information.
    Class: qqsp_ResourceException
    Error #: [1001, 3]
    Detected at: qqrt_ForteExecAgent::LoadPartition at 1
    Error Time: Tue Aug 18 17:52:44
    Exception occurred (locally) on partition "Forte_Executor", (partitionId =
    9EA25A00-36FE-11D2-87C4-502F15BEAA77:0x1, taskId =
    [9EA25A00-36FE-11D2-87C4-502F15BEAA77:0x1.6]) in application
    "FTCompile_cl0", pid 28331 on node stardev in environment <unknown>.
    FATAL ERROR: Invalid class ProductBMServices.ProductSecurityMgrProxy
    (0x4ecd,0x19a)
    Class: qqsp_ImplementationException
    Detected at: qqcg_TRclass::SetClass at 2
    Last TOOL statement: method ForteCompiler.ProcessPGF
    Error Time: Tue Aug 18 17:52:44
    Exception occurred (locally) on partition "Forte_Executor",
    (partitionId = 9EA25A00-36FE-11D2-87C4-502F15BEAA77:0x1, taskId =
    [9EA25A00-36FE-11D2-87C4-502F15BEAA77:0x1.6]) in application
    "FTCompile_cl0", pid 28331 on node stardev in environment <unknown>.
    The solution for this instance is to clean up the invalid classes using the c4tstdrv utility.
    c4tstdrv > setrepos star8
    c4tstdrv > setwork dmcompiledbuild
    c4tstdrv > open
    Type Service Flags Level
    err sh * 255
    trc rp 1 4
    c4tstdrv > findproj productbmservices
    c4tstdrv > cleanuprtclasses
    Removing extraneous RTclass ProductShootingLocationMgrProxy
    Removing extraneous RTclass PRTerritoryBaseMgrProxy
    Removing extraneous RTclass PRTerritoryMgrProxy
    Removing extraneous RTclass TalentBaseMgrProxy
    Removing extraneous RTclass TalentTypeMgrProxy
    Removing extraneous RTclass TitleTypeBaseMgrProxy
    Removing extraneous RTclass TitleTypeMgrProxy
    Removing extraneous RTclass ProductSecurityBaseClass
    Removing extraneous RTclass ProductSecurityBaseQuery
    Removing extraneous RTclass ProductSecurityQuery
    Removing extraneous RTclass ProductSecurityMgrProxy
    c4tstdrv > commit
    c4tstdrv > exit
    Integrate the changes to the workspace, start the build again and this should have cured the problem.
    However, its hard to know what the cause of your problem is without seeing the output in the log files.
    Good luck.
    Mark Carruthers
    20th Century Fox
    "Forte Consultants" <[email protected]> 01/22/99 08:35am >>>
    Hi,
    I'm doing application distribution for my application using a fscript
    script and am forcing compilation on 2 of my partitions.
    This I have been doing from quite sometime successfully. Recently I
    developed a new service and plugged it into my application for
    deployment.
    I'm successfully able to distribute & deploy the interpreted code. But
    I'm getting a long list of system errors when I try doing distribution
    for compiled code. And I see only one of the .exe generated instead of
    two because of which I'm unable to go ahead with installaion. I would
    appreciate if anybody let me know why this's happening ?. The following
    is the main chunk of this error list.
    Thanks in advance.
    --Anand Ramaswamy
    SYSTEM ERROR: Cannot resolve the distributed reference for an object of
    class
    (qqlo_Object) named (<Unknown>) for the reasons below.
    Class: qqsp_DistAccessException
    Error #: [601, 144]
    Detected at: qqdo_ProxyMgr::ResolveOutGoingProxy at 10
    Error Time: Fri Jan 22 10:44:22
    Exception occurred (locally) on partition "Fscript_cl9_Client",
    (partitionId = 32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1,
    taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1.1]) in application
    "fscript", pid 4b81 on node MOOSUP in environment IGTSDENV.
    SYSTEM ERROR: Can not initially communicate with the object named
    (Unnamed),
    which is supposed to be in partition
    (32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x616:0x1).
    Class: qqsp_DistAccessException
    Error #: [601, 140]
    Detected at: qqdo_ProxyMgr::CheckAccess at 1
    Error Time: Fri Jan 22 10:44:22
    Exception occurred (locally) on partition "Fscript_cl9_Client",
    (partitionId = 32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1,
    taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1.1]) in application
    "fscript", pid 4b81 on node MOOSUP in environment IGTSDENV.
    SYSTEM ERROR: Attempt to send to unknown destination partition
    (32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x616:0x1).
    Class: qqsp_DistAccessException
    Error #: [601, 102]
    Detected at: qqdo_PartitionMgr::SendMsg at 1
    Error Time: Fri Jan 22 10:44:22
    Distributed method called: qqdo_InternalMessage.<Message> (object
    name
    Unnamed) from partition "CodeGenerationSvc_cl0_Part1-router",
    (partitionId
    = 32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x615:0x1, taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x615.2]) in application
    "CodeGenerationSvc_cl0", pid 7487 on node MOOSUP in environment
    IGTSDENV
    Exception occurred (locally) on partition "Fscript_cl9_Client",
    (partitionId = 32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1,
    taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1.1]) in application
    "fscript", pid 4b81 on node MOOSUP in environment IGTSDENV.
    SYSTEM ERROR: Partition (32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x616:0x1)
    no
    longer exists. The process associated with the partition probably
    terminated.
    Class: qqsp_DistAccessException
    Detected at: qqdo_PartitionMgr::CheckStarted at 1
    Error Time: Fri Jan 22 10:44:22
    Exception occurred (locally) on partition "Fscript_cl9_Client",
    (partitionId = 32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1,
    taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1.1]) in application
    "fscript", pid 4b81 on node MOOSUP in environment IGTSDENV.
    SYSTEM ERROR: This method invocation is being retried because the
    failures
    shown below and the fact that the dialog duration is MESSAGE. This is
    try #2.
    Class: qqsp_DistAccessException
    Error #: [601, 54]
    Detected at: qqdo_Message::Failed at 1
    Error Time: Fri Jan 22 10:44:19
    Exception occurred (locally) on partition "Fscript_cl9_Client",
    (partitionId = 32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1,
    taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1.1]) in application
    "fscript", pid 4b81 on node MOOSUP in environment IGTSDENV.
    SYSTEM ERROR: The load balanced router is disabled or has no members.
    This
    can happen if all of the members terminated or failed.
    Class: qqsp_DistAccessException
    Error #: [601, 161]
    Detected at: qqdo_LbRouter::Route at 1
    Error Time: Fri Jan 22 10:44:19
    Distributed method called: GenerationMgrProxy.GeneratePartitionCode
    (object name
    site/codegenerationsvc_cl0/codegenerationsvc_cl0-codegensvc)
    from partition "Fscript_cl9_Client", (partitionId =
    32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1, taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614.2]) in application
    "fscript",
    pid 4b81 on node MOOSUP in environment IGTSDENV
    Exception occurred (remotely) on partition
    "CodeGenerationSvc_cl0_Part1-router", (partitionId =
    32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x615:0x1, taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1.10]) in
    application
    "CodeGenerationSvc_cl0", pid 7487 on node MOOSUP in environment
    IGTSDENV.
    SYSTEM ERROR: This method invocation is being retried because the
    failures
    shown below and the fact that the dialog duration is MESSAGE. This is
    try #1.
    Class: qqsp_DistAccessException
    Error #: [601, 54]
    Detected at: qqdo_Message::Failed at 1
    Error Time: Fri Jan 22 10:44:15
    Exception occurred (locally) on partition "Fscript_cl9_Client",
    (partitionId = 32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1,
    taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1.1]) in application
    "fscript", pid 4b81 on node MOOSUP in environment IGTSDENV.
    SYSTEM ERROR: Access to a load balanced router member (which is a
    service
    object) failed for the reasons below.
    Class: qqsp_DistAccessException
    Error #: [601, 162]
    Detected at: qqdo_LbRouter::Route at 2
    Error Time: Fri Jan 22 10:44:15
    Distributed method called: GenerationMgrProxy.GeneratePartitionCode
    (object name
    site/codegenerationsvc_cl0/codegenerationsvc_cl0-codegensvc)
    from partition "Fscript_cl9_Client", (partitionId =
    32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1, taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614.3]) in application
    "fscript",
    pid 4b81 on node MOOSUP in environment IGTSDENV
    Distributed method called: qqlo_Object.<Message> (object name
    Unnamed)
    from partition "Forte_Executor", (partitionId =
    32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x615, taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x615.12]) in application
    "CodeGenerationSvc_cl0", pid 7487 on node MOOSUP in environment
    IGTSDENV
    Exception occurred (remotely) on partition
    "CodeGenerationSvc_cl0_Part1-router", (partitionId =
    32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x615:0x1, taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1.10]) in
    application
    "CodeGenerationSvc_cl0", pid 7487 on node MOOSUP in environment
    IGTSDENV.
    SYSTEM ERROR: Cannot resolve the distributed reference for an object of
    class
    (qqlo_Object) named (<Unknown>) for the reasons below.
    Class: qqsp_DistAccessException
    Error #: [601, 144]
    Detected at: qqdo_ProxyMgr::ResolveOutGoingProxy at 10
    Error Time: Fri Jan 22 10:44:15
    Distributed method called: qqlo_Object.<Message> (object name
    Unnamed)
    from partition "Forte_Executor", (partitionId =
    32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x615, taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x615.12]) in application
    "CodeGenerationSvc_cl0", pid 7487 on node MOOSUP in environment
    IGTSDENV
    Exception occurred (remotely) on partition
    "CodeGenerationSvc_cl0_Part1-router", (partitionId =
    32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x615:0x1, taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1.10]) in
    application
    "CodeGenerationSvc_cl0", pid 7487 on node MOOSUP in environment
    IGTSDENV.
    SYSTEM ERROR: This distributed reference was previously invalidated due
    to the
    reasons below.
    Class: qqsp_DistAccessException
    Error #: [601, 132]
    Detected at: qqdo_ProxyMgr::ResolveOutGoingProxy at 3
    Error Time: Fri Jan 22 10:44:15
    Exception occurred (remotely) on partition
    "CodeGenerationSvc_cl0_Part1-router", (partitionId =
    32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x615:0x1, taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1.10]) in
    application
    "CodeGenerationSvc_cl0", pid 7487 on node MOOSUP in environment
    IGTSDENV.
    INFORMATION: The connection to the partner was terminated by the
    Communication
    Manager for the reasons below.
    Class: qqsp_DistAccessException
    Detected at: qqdo_PartitionMgr::StopLocation at 1
    Error Time: Fri Jan 22 10:44:15
    Exception occurred (remotely) on partition
    "CodeGenerationSvc_cl0_Part1-router", (partitionId =
    32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x615:0x1, taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1.10]) in
    application
    "CodeGenerationSvc_cl0", pid 7487 on node MOOSUP in environment
    IGTSDENV.
    INFORMATION: Network partner closed connection. This usually means the
    process at the other end of the wire failed. Please go look there and
    find
    out why.
    Class: qqsp_DistAccessException
    Detected at: qqcm_HoseFSM::ReceivedClose at 2
    Error Time: Fri Jan 22 10:44:15
    Exception occurred (remotely) on partition
    "CodeGenerationSvc_cl0_Part1-router", (partitionId =
    32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x615:0x1, taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1.10]) in
    application
    "CodeGenerationSvc_cl0", pid 7487 on node MOOSUP in environment
    IGTSDENV.
    INFORMATION: Asynchronous Failure: Recieved a close from the network
    partner:
    Internet Location - Host: moosup.iroquois.com Port Number: 2504 Dot:
    193.1.11.26 %LINKDISCON, network partner disconnected logical link
    Event 4
    Class: qqsp_DistAccessException
    Detected at: qqcm_HoseFSM::ReceivedClose at 1
    Error Time: Fri Jan 22 10:44:15
    Exception occurred (remotely) on partition
    "CodeGenerationSvc_cl0_Part1-router", (partitionId =
    32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x615:0x1, taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1.10]) in
    application
    "CodeGenerationSvc_cl0", pid 7487 on node MOOSUP in environment
    IGTSDENV.
    SYSTEM ERROR: This method invocation is being retried because the
    failures
    shown below and the fact that the dialog duration is MESSAGE. This is
    try #1.
    Class: qqsp_DistAccessException
    Error #: [601, 54]
    Detected at: qqdo_Message::Failed at 1
    Error Time: Fri Jan 22 10:44:15
    Exception occurred (remotely) on partition
    "CodeGenerationSvc_cl0_Part1-router", (partitionId =
    32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x615:0x1, taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1.10]) in
    application
    "CodeGenerationSvc_cl0", pid 7487 on node MOOSUP in environment
    IGTSDENV.
    INFORMATION: The connection to the partner was terminated by the
    Communication
    Manager for the reasons below.
    Class: qqsp_DistAccessException
    Detected at: qqdo_PartitionMgr::StopLocation at 1
    Error Time: Fri Jan 22 10:44:15
    Distributed method called: qqlo_Object.<Message> (object name
    Unnamed)
    from partition "Forte_Executor", (partitionId =
    32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x615, taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x615.12]) in application
    "CodeGenerationSvc_cl0", pid 7487 on node MOOSUP in environment
    IGTSDENV
    Exception occurred (remotely) on partition
    "CodeGenerationSvc_cl0_Part1-router", (partitionId =
    32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x615:0x1, taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1.10]) in
    application
    "CodeGenerationSvc_cl0", pid 7487 on node MOOSUP in environment
    IGTSDENV.
    INFORMATION: Network partner closed connection. This usually means the
    process at the other end of the wire failed. Please go look there and
    find
    out why.
    Class: qqsp_DistAccessException
    Detected at: qqcm_HoseFSM::ReceivedClose at 2
    Error Time: Fri Jan 22 10:44:15
    Exception occurred (remotely) on partition
    "CodeGenerationSvc_cl0_Part1-router", (partitionId =
    32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x615:0x1, taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1.10]) in
    application
    "CodeGenerationSvc_cl0", pid 7487 on node MOOSUP in environment
    IGTSDENV.
    INFORMATION: Asynchronous Failure: Recieved a close from the network
    partner:
    Internet Location - Host: moosup.iroquois.com Port Number: 2504 Dot:
    193.1.11.26 %LINKDISCON, network partner disconnected logical link
    Event 4
    Class: qqsp_DistAccessException
    Detected at: qqcm_HoseFSM::ReceivedClose at 1
    Error Time: Fri Jan 22 10:44:15
    Exception occurred (remotely) on partition
    "CodeGenerationSvc_cl0_Part1-router", (partitionId =
    32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x615:0x1, taskId =
    [32271CD0-4E62-11D2-AF29-9F40A9E1AA77:0x614:0x1.10]) in
    application
    "CodeGenerationSvc_cl0", pid 7487 on node MOOSUP in environment
    IGTSDENV.
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Hi,
    If this INCLUDE is in a function group go the MAIN program and activate from there.
    Can you list out the include name?

  • FPGA Code Generation fails with error codes 7 and -1

    Hi all,
    I have been having a weird issue with my LV FPGA compilation in the last couple of days, no matter what I try to compile LV fails to generate the FPGA code files and returns with errors 7 and -1 and complains that the file is not found. This happens no matter what I am trying to compile even a VI with just a while loop. I followed the discussion forum here without any luck, also followed the NI article here and that did not help either. The error codes always get generated at the start of the Generating Intermediate files step #7 (out of 7).
    Attached to this post is a screenshot of the error I am getting (error -1 just says internal error and to contact NI support), bellow is basically the error I get for error code 7
    An internal software error has occurred. Please contact National Instruments technical support at ni.com/support with the following information:
    Error 7 occurred at Read from Text File in nirviGetInstantiation_cRIO-IDSel_Timer.vi->nirviGetInstantiation_cRIO-IDSel_Timer.vi.ProxyCaller
    Possible reason(s):
    LabVIEW: File not found. The file might have been moved or deleted, or the file path might be incorrectly formatted for the operating system. For example, use \ as path separators on Windows, : on Mac OS X, and / on Linux. Verify that the path is correct using the command prompt or file explorer.
    =========================
    NI-488: Nonexistent GPIB interface.
    C:\NIFPGA\compilation\cRioController_8-SlotFPGA_FPGA-TriggerTest_C06156E2\IDSel_Timer.vhd
    I tried to do some digging to see what could possibly be happening, and I noticed that LV is looking for the vhdl files in the wrong folder (see the line highlighted in red above), when generating the vhdl files, LV will place them inside the "source_files" folder under the compilation project, but for some reason it is trying to find them under the root folder not inside the source_files folder!!!
    Does anyone have any idea why LV would be looking for these files in the wrong subfolder? 
    Thank you,
    Aws
    Attachments:
    Code Generation Errors.png ‏35 KB

    Hi Aws_Khudhair,
    What version of LabVIEW are you using? And what version of the FPGA module? From what I found, it seems as though this is primarily an issue with LabVIEW 8.6 and 8.6.1.
    http://digital.ni.com/public.nsf/allkb/A711119FE89E39E78625754E00075E92
    This forum also discusses a similar issue:
     http://forums.ni.com/t5/Real-Time-Measurement-and/FPGA-compile-errors-after-generating-intemediate-f...
    It may also be worth repairing/reinstalling the FPGA Module and the Xilinx compile tools.
    Catherine B.
    Applications Engineer
    National Instruments

  • Code generation bug in Sun Studio 12

    Hi,
    The following program prints `Failure' when compiled with -xO4 where nothing should be printed (when compiled with no optimization or -xO2). It looks to me that the first comparison `buggy_routine' against 0x80 is returning True where it should return False.
    #include <stdlib.h>
    #include <stdio.h>
    typedef unsigned long long int      EIF_NATURAL_64;
    typedef unsigned char   EIF_BOOLEAN;
    typedef int EIF_INTEGER_32;
    typedef char * EIF_REFERENCE;
    char s[] = "9223372036854775808";
    void buggy_routine (EIF_REFERENCE Current, EIF_NATURAL_64 arg1)
        EIF_NATURAL_64 tu8_1;
        tu8_1 = (EIF_NATURAL_64) ((EIF_INTEGER_32) 128L);
        if ((EIF_BOOLEAN) (arg1 <= tu8_1)) {
        } else {
            if ((EIF_BOOLEAN) (arg1 <= ((EIF_NATURAL_64)  9223372036854775808ull ))) {
            } else {
                  printf("Failure\n");
    int main (int argc, char ** argv, char **envp ) {
        EIF_NATURAL_64 loc2 = (EIF_NATURAL_64) 0;
        loc2 = (EIF_NATURAL_64) atoll(s);
        buggy_routine ("s", loc2);
    }To reproduce:
    cc -xO4 bug.c -o bug ; ./bug
    It fails on both 32 and 64-bit code generation for x86. I haven't tried on Sparc as I need to install Sun Studio 12. Is this a known issue? Is there an easy workaround?
    I tried with Sun Studio 11 and it worked just fine there.
    Regards,
    Manu
    PS: I've tried with both version (the first is the one from the default installation) and the second after I noticed there were some patches available:
    cc: Sun C 5.9 SunOS_i386 Patch 124868-01 2007/07/12
    cc: Sun C 5.9 SunOS_i386 Patch 124868-02 2007/11/27

    An issue filed at bugs.sun.com does not go directly into the bug database. It is evaluated, and if it turns out the report is actually a bug not previously reported, goes into the database. You get a notification and chance to reply after the report is evaluated.
    In this case, I picked up your report myself, and filed the bug. The bug ID is 6654314, and will be visible at bugs.sun.com in a day or two.

  • Code 'Generation' with DRY (don't repeat yourself)??

    Hello I am new to the forum so please be kind,
    I have recently gotten an internship with one of the offices with my University and am working a project (for a while now). I spend most of the day just getting all the classes assembled to be used (often a two day process) and what I would like to do is pass in a few parameters then have it generate the majority of the standard code that takes so much time to type out.
    What I am referring to is Consructors/ Setters/ Getters and toString.
    Parameters:
    Class name
    int first 5
    double secondMost of this stuff is pretty standard, but I figured there was a template or something I could build to do much of this for me. Unfoturnaly the University teaches C++, so learning Java on my own is somewhat difficult at times.
    Oh. I had found a wikipedia page about a design method called DRY, basically it pointed out that I could do just what I am wanting to do, but unfortunately I cannot seem to find an example or any detailed information about this method.
    This is what I have rolling around in my head at the moment:
    The use a bunch of strings and printf("%s, args) ...to build this entire page, then go in and enter the things that I couldn't generate.
    I could see this working, but I had felt this would go against code resuability because when the class/things I would generate would change, I would have to do some serious changes to this to get it working again. (Maybe that is the point).
    I would greatly appreciate some guidance on this, or pointed to more information.
    Thanks

    dajohnson1s wrote:
    Hello I am new to the forum so please be kind,
    I have recently gotten an internship with one of the offices with my University and am working a project (for a while now). I spend most of the day just getting all the classes assembled to be used (often a two day process) and what I would like to do is pass in a few parameters then have it generate the majority of the standard code that takes so much time to type out.
    What I am referring to is Consructors/ Setters/ Getters and toString.
    Parameters:
    Class name
    int first 5
    double second
    Most of this stuff is pretty standard, but I figured there was a template or something I could build to do much of this for me. Unfoturnaly the University teaches C++, so learning Java on my own is somewhat difficult at times.
    First step is recognizing a pattern.
    Second step, experience wise, is learning to recognize the difference between something that should be generated and something that shouldn't.
    Third step is implementation.
    Code generation should only be used if it can be insured that it eases the task now and in addition does not complicate the task in the future. That must include the possibility that the generation part will be abandoned so the generated code itself must be in such a state that it can be maintained.
    Once you have a pattern then you must choose a way to represent the pattern as a 'source'. Sources can one or more of the following: text, xml, sql scripts, sql databases, existing source files, existing code bases, design document, pdf files. Anything that you can extract a definition from will work.
    An example text file relevant to your task might look like this.
          Class: XxxMyclas
          Attribute: Count int
          Attribute: Name String.From that you create a standard compiler type idiom
    1. Parse (read file and collect data)
    2. Syntax (validate collected data, which might also be part of 1)
    3. Generate (use data to generate new source)
    Each phase can embodied certain complications (can not must). Some examples.
    1. Parse - provide an xml to define data types.
    2. Generate - provide a template file used to generate the code, define where the output goes, insure existing files not overwritten, etc.
    Your description sounds like a one shot - in that you will not be generating every everytime but rather will generate it once and then modify it.
    Oh. I had found a wikipedia page about a design method called DRY, basically it pointed out that I could do just what I am wanting to do, but unfortunately I cannot seem to find an example or any detailed information about this method.
    The only general books I have found on the subject is one directed at Perl (Perl Munging) which is sort of related and one for .Net (or maybe java) but which is directed at a proprietary commercial product.
    This is what I have rolling around in my head at the moment:
    The use a bunch of strings and printf("%s, args) ...to build this entire page, then go in and enter the things that I couldn't generate.
    I could see this working, but I had felt this would go against code resuability because when the class/things I would generate would change, I would have to do some serious changes to this to get it working again. (Maybe that is the point).
    Code generation has its best usage if you can recognize a pattern and then implement it such that manual modifications are not needed. This however is tempered by the requirement that I first mentioned that the generated code must be maintainable by itself.

  • Code generation bug in C++ 5.0

    The enclosed test program generates incorrect code
    with C++ 5.0 when -g is not used.
    The problem showed up in our production code
    and concerns any reference counted smart pointer
    implementation.
    The test program is specifically written to demonstrate
    the problem and diagnose a reference miscount.
    With any optimization at all (without -g, and/or with
    any level of -O including no -O) it generates
    incorrect results. With -g the results are correct.
    gcc compiles this correctly with any optimizations
    selected.
    // main.cc
    // test program to demonstrate code generation bug in
    // Sun WorkShop Compilers C++ 5.0
    // bug exhibited as of 27th April 2001
    // relevant patches applied:
    // 107289-05 Packages: SPROcc
    // 107390-12 Packages: SPROtl7x, SPROsclx, SPROtll7x, SPROcplx, SPROlgcx
    // 107311-12 Packages: SPROscl, SPROtll7, SPROtlbn7, SPROcpl, SPROgc, SPROlgc
    // 107357-11 Packages: SPROlang
    // correct behaviour with CC -g:
    // CC -g main.cc -o main; ./main
    // incorrect behaviour with CC (no -g):
    // CC main.cc -o main; ./main
    #include <stdio.h>
    class O {
    public:
    inline O() : m_refCount(0) { };
    inline void ref() { m_refCount++; }
    inline void deref() { m_refCount--; }
    inline int refCount() { return(m_refCount); }
    private:
    int m_refCount;
    class R {
    public:
    inline R() : m_object(0) { };
    inline R(const R &r) : m_object(r.m_object) { if (m_object) m_object->ref(); }
    inline R(O *o) : m_object(o) { if (o) o->ref(); };
    inline ~R() { if (m_object) m_object->deref(); }
    inline R &operator =(const R &r) {
    if (this == &r) return(*this);
    O *o = m_object;
    if (m_object = r.m_object) m_object->ref();
    if (o) o->deref();
    return(*this);
    inline R &operator =(O *n) {
    if (m_object == n) return(*this);
    O *o = m_object;
    if (m_object = n) n->ref();
    if (o) o->deref();
    return(*this);
    inline operator O *() const { return(m_object); }
    inline O *operator ->() const { return(m_object); }
    private:
    O *m_object;
    class B {
    public:
    inline B(const R &r) : m_ref(r) { };
    inline const R &ref() { return(m_ref); }
    private:
    R m_ref;
    R buggy(int notnull, B &b)
    return(notnull ? b.ref() : 0); // BUG HERE
    int main()
    O o;
    R r(&o);
    B b(r);
    int i;
    for (i = 0; i < 20; i++) {
    R s;
    s = buggy(!0, b);
    printf("refCount: %d (should be 2)\n", o.refCount());

    How do I file a bug report for this and get
    a bug ID assigned?

  • Code generation problem with deployejb !

    I am working with Oracle 8.1.5 and jdk 1.1.6,
    when I am running the deployejb tool with the HelloWorld example of the demo directory, I have a problem with the code generation of the EJBHome and EJBObject:
    deployejb -u ...
    ... [deployejb found HelloHome.class]
    done
    Generating EJBHome and EJBObject on the server...
    An exception occured during code generation: Class not found : hello.HelloHome.class
    Note my CLASSPATH variable is correctly set.
    Can you HELP me ?
    null

    Adding -W2,-Rcond_elim to the existing flags does make both the small example and the original code compile correctly.
    --David                                                                                                                                                                                                                                                               

  • Code Generation Error - SUP 2.2 / SUW 2.2

    Hi,
    I have formatted my laptop PC and re-installed Sybase Unwired Workspace 2.2. After the installation I get Code Generation Error message:
    Before Code Generarion attemp the Java Build Path / Source tab is empty and after the Code Generation the error specified above is generated and the following path is added to the Java Build Path / Source tab:
    XXX/Generated Code/src (missing)
    I cannot resolve the problem. Does anybody has idea about the problem?
    thanks,

    Hi,
    1. I created a new model having only one MBO and generated code successfuly.
    2. The result is the same after deletion of "Generated Code" and creating new folder
    3. The result is the same after generation code to another folder.
    nothing has changed but I discovered additional information in the "workspace\.metadata\.log" file:
    com.sybase.uep.tooling.codegeneration.coordinator.CoordinatorException: Member not found: inverseClass on object com.sybase.afx.compiler.AttributeDef@2a3881
      at com.sybase.uep.tooling.codegeneration.coordinator.impl.ClientObjectAPICoordinator.sendRequest(ClientObjectAPICoordinator.java:115)
      at com.sybase.uep.tooling.codegeneration.ui.CodeGenerationJob.sendRequest(CodeGenerationJob.java:200)
      at com.sybase.uep.tooling.codegeneration.ui.CodeGenerationJob.processTasks(CodeGenerationJob.java:172)
      at com.sybase.uep.tooling.codegeneration.ui.CodeGenerationJob.runInWorkspace(CodeGenerationJob.java:123)
      at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
    Caused by: com.sybase.uep.tooling.codegeneration.clientobjectapi.ClientObjectAPIException: Member not found: inverseClass on object com.sybase.afx.compiler.AttributeDef@2a3881
      at com.sybase.uep.tooling.codegeneration.coordinator.CoordinatorException.<init>(CoordinatorException.java:27)
      ... 6 more
    Caused by: com.sybase.modeling.templatej.runtime.adapter.impl.NoSuchMemberException: Member not found: inverseClass on object com.sybase.afx.compiler.AttributeDef@2a3881
      at com.sybase.uep.tooling.codegeneration.CodeGenerationException.<init>(CodeGenerationException.java:26)
      at com.sybase.uep.tooling.codegeneration.clientobjectapi.ClientObjectAPIException.<init>(ClientObjectAPIException.java:27)
      at com.sybase.uep.tooling.codegeneration.clientobjectapi.impl.ClientObjectAPIDelegator.generate(ClientObjectAPIDelegator.java:155)
      at com.sybase.uep.tooling.codegeneration.coordinator.impl.ClientObjectAPICoordinator.sendRequest(ClientObjectAPICoordinator.java:86)
      ... 5 more

  • Code Generation Bug in Forms 10g

    We're hitting this goofy bug in Forms 10g (also occurs in 9i) code generation of the On-xxx triggers. I have an "obj" package that declares an index-by array type that's used by multiple packages, including a "qry" package and "dml" package (in good ol' Steven Feuerstein tradition). The On-xxx triggers pass this type into packaged procedures that perform the Insert, Update, Delete and Lock required by Forms. These DML routines are in the "dml" package.
    When we look at the generated trigger code, we see that the index-by array type is incorrectly referenced as dml.obj.idx. That is, since the On-xxx trigger is calling DML routines in the "dml" package, it's improperly qualifying the reference with the dml package name. The On-xxx trigger code gets regenerated every time we do Compile Module. We tried doing Compile All, which doesn't regenerate the On-xxx triggers; but neither does it produce an fmx file.
    Is this a known bug, and is there a workaround? I can't move the index-by array type declaration to the dml package because it's used by multiple packages. If I fix it in one place, I break it in another. I can't have multiple declarations of this type in multiple packages either, because I'm passing it around between the packages, and they're not type-compatible at that point.

    It looks like the Forms Wizard is the real culprit. When we looked at the Property Palette for each On-xxx trigger, where the target procedure is specified, along with the parameters, is where the malformed dml.obj.ref code appears. Once we edited those entries, the On-xxx triggers generated correctly.

  • Compile code in a file

    i have some java codes in my "fl.txt"(c:\fl.txt). these are;
    public class file_{
    public static void main(String args[]){
    System.out.print("hello world");
    }i want to compile these code from my program(i am building it with java) at runtime.. how can ii do that.i think i need to use runtime.exec() method but i dont know how can i compile these codes in a file....

    It is possible to dynamically compile code from within a running Java program,
    but you should have a damn good reason for doing so.
    Check out the documentation for javac: http://java.sun.com/javase/6/docs/technotes/tools/windows/javac.html
    <quote>
    javac supports the new Java Compiler API defined by the classes and interfaces in the javax.tools package.
    Example
    To perform a compilation using arguments as you would give on the command line, you can use the following:
    JavaCompiler javac = ToolProvider.getSystemJavaCompiler();
    int rc = javac.run(null, null, null, args);This will write any diagnostics to the standard output stream, and return the exit code that javac would give when invoked from the command line.
    You can use other methods on the javax.tools.JavaCompiler interface to handle diagnostics, control where files are read from and written to, and so on.
    </quote>
    If you are using an older version of Java, check out the documentation to see the old interface to do this (com.sun.tools.javac.Main).

  • NI Veristand 2014 doesn't appear in MATLAB R2014a Code generation

    Hi
    I installed NI Veristand 2014 after installing MATLAB R2014a. I restarted my PC and tried to apply the sinewave example. I looked at code generation in Simulink model configuration parameters but couldn't find the NIVeristand option as illustrated in video. Here is a screenshot of system target file:
    Did I miss installing something? That was my installation (since I need Veristand to compile MATLAB model):
    Thanks for your assistance in advance
    Waleed El-Badry MSc.,MCPD, ISTQB Certified Tester
    Assistant Lecturer
    Mechatronics Department
    Faculty of Engineering
    Misr University for Science & Technology
    Solved!
    Go to Solution.

    Hi Waleed,
    Unfortunately the behavior your are experiencing is a fault in our installer's auto-detection of MATLAB R2014a. The NI VeriStand 2014 node you see in the installer setup window is actually hiding several other unique options. The default selections should auto-select MATLAB support if MATLAB was successfully detected by our installer, unfortunately this procedure has failed.
    To workaround this:
    1. Relaunch the installer setup window
    2. In the Features setup window (your second picture), left click on the image next to the NI VeriStand 2014 label
    3. You should now be presented with the option, Install with customization - select this option.
    4. Proceed with the installation, eventually you be presented with custom options for the VeriStand product.
    5. In the VeriStand feature list, select the NI VeriStand 2014 Model Framework option
    6. Proceed with the installation.
    After this, restart MATLAB and then relaunch. If the installation was successful, on relaunch of  the MATLAB COmmand Window will print the string Initializing NI VeriStnad 2014. Please note that we've documented this issue and are making an effort to address it.
    Nestor

  • JavaBeans code generation from XSD

    Hi everyone,
    I know that this is not a new question, but I still did not find a satisfying answer.
    Does anyone know a good code generator for creating JavaBeans out of XSD schemas?
    The output of this tool has to comply with the JavaBeans specification, because we want to map these POJOs to a database with the Java Persistence API. Especially lists and sets need to be created correctly, because we will make heavy use of associations.
    I've evaluated a large number of tools, most of them are not useable together with JPA. Here is a short list of tools I already tried:
    - Castor: Really nice tool, but getter-methods for "java.util.List" objects return a copy of this list as array! Output is not a JavaBean!
    - XMLBeans: As far as I've seen, Java objects have to be retrieved via a factory method, I see no possibility to use this library together with JPA. I furthermore doubt that these objects are JavaBeans.
    - HyperJaxb2+3: This tool promises to create Java POJOs and Hibernate mappings at the same time. The description looks very good, but the page seems to be down. I was not able to initiate a download for days.
    - Altova XMLSpy: This tool allows the generation of Java code out of XSD schemas. But the result is rather ugly. A simple XML "string" is translated into an internal Java class definition instead of a simple "String" instance. I see no usage of these objects together with JPA.
    I spent quite a lot of time for searching a good code generation framework that works together with JPA. Has anyone made good experience with any kind of code generators in this area?
    Thanks for any help!
    Martin

    Hi dvohra09,
    thanks for your reply. I think JAXB has the same limitations than XMLBeans. As I read at http://java.sun.com/javaee/5/docs/tutorial/doc/JAXB6.html, object instances shall be only accessed via a factory:
    "You should never directly use the generated implementation classes--that is, *Impl.java in the <packagename>/impl directory. These classes are not directly referenceable because the class names in this directory are not standardized by the JAXB specification. The ObjectFactory method is the only portable means to create an instance of a schema-derived interface. There is also an ObjectFactory.newInstance(Class JAXBinterface) method that enables you to create instances of interfaces. "
    Did you use JAXB2 together with the Java Persistence API? If yes, can you give me please an example how to map generated classes to the database?
    Thanks for your help!
    Martin

  • Fpga code generation error after updating from 8.5.0 to 8.5.1

    Hi All,
    I have a FPGA-VI which was compiled in LV 8.5.0 without errors. After I updated to 8.5.1 the Code Generation stops, telling me the clock domain is not supported for write FPGA I/O node (see attachment).  Also I attached a picture of a simplified FPGA-VI which brings up the same error.
    I use a PXI-7833R connected to a cRIO-9151 R Series Expansion Chassis with a NI-9421 modul (8-ch DI, 24V) installed in it.
    My original FPGA-Code has a theoretical maximum of 22MHz, so I can't change the clock domain to 40MHz.
    Do you have any suggestion how to get the VI compiled?
    Uli
    Solved!
    Go to Solution.
    Attachments:
    ErrorMessage1.jpg ‏30 KB
    FPGA-VI1.jpg ‏17 KB

    Hi Ruhmann, hi Basset Hound,
    thank you for your reply and giving me a better insight in things.
    I started my VI with 40MHz clock domain. The Vi got bigger, some more logic here and some more code there. Finaly the compiler couldn't satisfy the timing any more. Instead of optimising the code, I reduced the clock domain.
    Until your post I didn't realise I use CompactRIO I/O. Is There a difference to (let me call it) "direct R-Series I/O"?
    I need the Expansion Chassis (Connector 1), the 9421 (8-ch DI) and 94?? (8-ch DO) to connect 24V logic to the FPGA. Additionally I have two SCB-68 (Connector 2+3) for 5V logic (DI, DO, A/B linear position measurement, pulse generation) and some analog input. All code in 1 VI, but distributed in 3 loops.
    To change the clock domain back to 40MHz, I have to optimise my code . Well, the code is sloppy , so optimising is OK .
    To tell the hole story:
    After updating to 8.5.1, my first contact to NI was by phone. The engineer asked for the Code, the project and the hardware.
    It took a while for me to put the information in an email. Meanwhile engineer the found a paper with the solution I
    mentioned in my second post and send it to me, before looking at my code. The paper said someting about "tightend timing constraints",
    "safe communication" and "multiple DMA target to host transfer". Not exactly what I was doing, but I reinstalled
     RIO 2.3.1 and ... compile successful.
    @ Basset:
    The simple VI (picture) in my first post reproducese the issue exactly.
    I'm not at work any more, so I can't provide the full code or the SRQ# until tuesday (holiday on monday ).
    FYI I'm located in Germany, so I called the german NI support.
    Uli

  • Model interface toolkit (MIT) code generation failes in simulink

    Hello,
    I'm running into an odd Simulink Coder failure and I can't tell if this is due to an NI/MIT but or a general Simulink Coder issue.
    System:
    Windows 7
    Matlab/Simulink R2013b w/ Simulink Coder
    MIT 2013 SP1
    System target file = "NIVeriStand_VxWorks.tlc"
    Not that we even get to this point but... my "WindRiver GNU Toolchain Setup Path" is properly configured to: c:\gccdist\supplemental\setup-gcc.bat
    The attached image shows the error I'm getting:
              "Error: Invalid character in: 'SMA_model/SMA Driven Arm/wire/Heat Transfer Model/ ', exiting code generation. The name cannot end with / character".
    In the image you can see that the "Heat Transfer Model" subsystem in fact does not have a "/" in the name. 
    Has anyone else ever run into this code generation problem before? If so, any suggestions on how to get around it?
    Thanks.
    Solved!
    Go to Solution.
    Attachments:
    SimulinkCoderError.png ‏92 KB

    That error is actually being reported by Simulink® before the build process begins. I'm guessing you would see it regardless of the TLC file you choose. Interestingly, in my tests here Simulink® doesn't allow me to leave a subsystem with a "/" at the end of the name. It automatically changes the name back to what it was before I tried to add the "/." That same error you see in the compilation window is displayed in the command line output when I attempt it. It looks like I'm running a different version than you though. 
    The screen shot doesn't really confirm the subsystem block name itself, at least the hierarchy at the top of the window appears to have parsed out all backlashes. Could you provide a screenshot of the heat transfer model subsystem block? 
    MATLAB®, Simulink®, and Real-Time Workshop® are registered trademarks of The MathWorks, Inc.  All other trademarks are the property of their respective owners.
    Applications Engineer
    National Instruments
    CLD Certified

  • APT and Java source code generation

    Hi all,
    In many articles about APT tool, I read that it is possible to generate Java source code from annotations read by AnnotationProcessorFactory.
    I am very interesting by this possibility but I can't find an exemple (all exemples I found display informations only).
    Where can I find a concrete exemple of this functionnality ?
    Thanks
    Micka�l

    Micka�l
    I have a project on java.net that has several examples of code generation.
    Go to the project source code here.
    https://rapt.dev.java.net/source/browse/rapt/
    The ones here are quite simple
    https://rapt.dev.java.net/source/browse/rapt/src/net/java/dev/rapt/proposed/generators/
    and these packages are more complex
    https://rapt.dev.java.net/source/browse/rapt/src/net/java/dev/rapt/exploratory/#dirlist
    Check out the javadoc to see how they should be used.
    One pointer is, work out exactly what you want to generate first. Then code an example by hand, then make sure it compiles and does what you want it to do. That way you know exactly what you need to generate. It is much quicker to fix compiler and functional errors in your hand coded example, than to change the generator, recompile that, then run it to generate and compile the code.
    If you do find errors in your generated code, tweak the generated code by hand till it works, then go back and change the generator to do the right thing.
    A second point is: generate nicely formatted code, indented etc, then when it doesn't work, or doesn't even compile, you can at least read the generated code to debug it.
    Bruce

Maybe you are looking for

  • I just installed a LaCie 3TB harddrive on my iMac and now my iTunes won't open.

    I just installed a LaCie 3TB hard drive on my iMac and my iTunes will not open. It says some kind of error. The dude at the apple store told me this would be really easy to setup - total fail! Please help, I am not good with technology.

  • Erro SOAP Receiver: handshake failure

    Pessoal, boa tarde. Tenho um Canal de Comunicação SOAP Receiver, com autenticação por usuário e senha. Ao enviar a requisição para o Channel, é gerado o seguinte erro: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> - <SAP:Error xmlns:SAP="h

  • Out of memory Error in OBIEE11.1.1.6.7 RPD

    Hi All, While merging two RPD's in 11.1.1.6.7 using two way and three merging we are getting 'Out of memory' error. Please guide me how to resolve this type of issues. THanks, Siva.

  • Compressor no longer works!!

    My system just downloaded an update for compressor yesterday and now it won't open the window that lets you choose a movie to work with. There is no menu under Window that lets you open this particular window. Can anyone tell me what has happened? I'

  • FI-AA: table(-s) for the asset value

    Dear forum members, I need to find the table where I can get the asset value from!? The background is that I`m writing a report where I have to get the value of an asset. If it is higher then 0,00 then it has to do this and if it lower than 0,00 it h