Creating General Waveform with X Series

Hi all ,
I have CVI 9.1 And UBS NI-6356.
I want to create a software that will set Analog output General ( Arbitrary ) linear waveform based on var that will be set on the my GUI.
For example if I'll set :
Start voltage - 1V  Start time - 0ms
End Voltage - V  End time - 50ms
Freq - 50hz 
Number of points - 500.
The soft will take all the vars and create a Linear equation ( Voltage , Time ) , create an array of data for the wave form and send it throw analog output.
My problem is that I need to use the arbitrary wave form with the NI Fgen but the examples are not so clear is there any explanation page ? Or maybe some one can copy only the needed functions...
Thank you.
Kobi Kalif
Software Engineer

A good place to start would be our C examples for generating voltage with DAQmx.
With DAQmx installed, navigate to: Start Menu >> Programs >> National Instruments >> NI-DAQ >> Text-based code support >> Ansi C Examples >> Analog Out >> Generate Voltage.
There are several good examples in this folder that will work with CVI.
Regards,
Aaron
National Instruments

Similar Messages

  • How can I automatically create the files with serie-name?

    Hello, Everyone,
    I have a question again.
    How can I automatically create the file with a serie-filename?
    e.g. I have a program, it will repeat 5 times, and every time it will create a bmp-file, and I want to let this program automatically save these 5 files with a Serie-filename like File001.bmp, File002.bmp, .... File005.bmp.
    How can I do it?`
    Thanks a lot.
    Regarts,
    Johnny

    Hi Deepu,
    one more comment
    The format code should be "%04d" to get leading zeros and have filenames with same length...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Waveform with time stamps randomly separated

    Folks,
    I'd like to get your advice on the following task.
    A spectrometer takes data at arbitrary, not foreseeable instants. To each new point a time stamp is attached. The data shall be displayed in a waveform graph with the data coordinate on the y-axis, the data points being appropriately spaced with the correct time stamps on the x-axis.
    How can I do this? How can I create a waveform with arbitrarily spaced time lag between the points?
    Thanks for any hint,
    Peter

    Hi Ben,
    you don't have excuse, it's a nice example.
    So I learned something new: how to trick a waveform chart to display values without fixed dt
    (Even when it needs some conversion routines when you collect your data in arrays...)
    Message Edited by GerdW on 08-23-2007 02:18 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • General advice on creating a messenger with flash

    Hello everyone !
    I would like to ask the experienced on the following matter -
    I have chosen to create a messenger with the use of Flash
    technology for my Master's Thesis, but up to now I only had
    experience in writing standalone games in general (so no networking
    included). I'm also from the AS 2.0 era, but my Tech University has
    recently obtained a licence for Flash CS3 so I'll be moving to AS 3
    soon. Anyway I'm still more or less clueless on where to start.
    My promoter suggested using XMLSockets (would that also mean
    creating some server side application in PHP or Java ?), but since
    I believe these are available from like Flash 5, I'm guessing there
    are newer and better solutions to the problem ? I'm of course not
    asking about any ready solutions, I'll be happy to explore them
    myself, yet a general overview of my options would be more than
    welcome - especially that I will soon have to submit a general
    description of what this whole thing will more or less look like.
    For example - could I use Flash Media Server and Flash CS3
    and that would be enough ? Please share any thoughts on the topic.
    Cheers !
    Andrew

    i'm not sure how you'll set this up.  but each button must correspond to a url and you must supply that information.
    one way to do it would be to use an array that corresponds to your buttons.  so, the first array element is the url used by the first button, the 2nd array element is used by the 2nd button etc.  then:
    var urlA:Array=["www.adobe.com","www.kglad.com",etc];
    var gotoFrame1TO:uint;
    function gotoFrame1(){
        gotoAndPlay(1);
    for(var i:uint=1;i<=btnNum;i++){
        this["btn"+i].addEventListener(MouseEvent.ROLL_OUT,outF);
        this["btn"+i].addEventListener(MouseEvent.ROLL_OVER,overF);
        this["btn"+i].addEventListener(MouseEvent.CLICK,clickF);
        this["btn"+i].ivar = i;
    function outF(e:Event){
        gotoFrame1TO=setTimeout(gotoFrame1,500);
    function overF(e:Event){
        clearTimeout(gotoFrame1TO);
    function clickF(e:Event){
        navigateToURL(new URLRequest("http://"+(e.currentTarget.ivar-1)));

  • How to create a table with events in smartforms?

    How to create a table with events view in smartforms?
    It doesn't like general table with header, main area and footer.
    for example:
    in smartforms: LE_SHP_DELNOTE
    table name is TABLEITEM(Delivery items table)

    Vel wrote:
    I am creating XML file using DBMS_XMLGEN package. This XML file will contain data from two different database tables. So I am creating temporary table in the PL/SQL procedure to have the data from these different tables in a single temporary table.
    Please find the below Dynamic SQL statements that i'm using for create the temp table and inserting the data into it.
    Before insert the V_NAME filed, i will be appending a VARCHAR field to the original data.
    EXECUTE IMMEDIATE 'CREATE TABLE TEMP_TABLE (UNIQUE_KEY NUMBER , FILE_NAME VARCHAR2(1000), LAST_DATE DATE)';
    EXECUTE IMMEDIATE 'INSERT INTO TEMP_TABLE values (SEQUENCE.nextval,:1,:2)' USING V_NAME,vLastDate;What exactly i need is to eliminate the INSERT portion of it,Since i have to insert more 90,000 rows into it. Is there way to have the temp table created with data in it along with the sequence value as well.
    I'm using Oracle 10.2.0.4 version.
    Edited by: 903948 on Dec 22, 2011 10:58 PMWhat you need to do to eliminate the INSERT statement is to -- as already suggested by others - eliminate the temporary table. You don't need it. It is just necessary overhead. Please explain why you (apparently) believe that the suggestion of a view will not meet your requirements.

  • Synchroniz​e two waveforms with different time

    Hi All,
         Thank you again in advance for you help on this. I am trying to create a setup where a spectrum is generated over time (millisecond time range, this function works properly), and a maximum for a peak that I select (this also works correctly) plots over time (minute time scale). However, when I try to run this, the fast plot is operating at about 40 Hz, and I have a calculation to allow a resolution feature for the minute time graph (the fast experiment is averaged a given number of times to produce a spectrum which is then analyzed for the maximum peak, so for example, at 40 Hz, and a resolution of 0.5 seconds, it should need to average 20 spectra for each point), but in operation, the time does not work correctly. At 20 spectra averaged per point, I only get about one point per second, not 2. So, in an attempt to correct this, I cut the averages in half, and was able to get it to work at very nearly 2 spectra per second. However, the time is not exact when compared to an external clock, and I need to know then exact time. Thus, is there any way to have the minute time frame graph count time on its own, and just plot a Y value whenever it recieves one? I need to have it plot in real time, as is currently achieved in the attached vi. In th attached VI, I am working with the "chromatography mode" tab, the other tabs already work correctly. However, I am somewhat new at this, and my code is a bit messy, so I apologize for that in advance. Thank you,
    <>< Eric
    Attachments:
    IMS Software v5.4.vi ‏158 KB

    Hello Eric,
    I see that you are creating a waveform using the Build Waveform VI and then wiring it to the outputs in the Chromatography Mode tab - namely 'Waveform Graph' and 'Waveform Graph 3'. Is the 'dt' value constant for every iteration of the while loop? If so, your output should have constant time spacing between plotted values in the waveform graph.
    So, again I am not completely sure what you mean by the IMS not operating at the frequency you input :-(. Are you seeing the problem in 'Waveform Graph' or 'Waveform Graph 3' or both? An simple example VI would be great to describe your issue.
    Vivek Nath
    National Instruments
    Applications Engineer
    Machine Vision

  • How to Create Support Message with no SolMan User

    Hi all,
    I would like to test if it is possible to create a support message from ECC system, if the same user do not have a SolMan user.
    Now, in few other threads, like
    Creation of support message in SolMan without having user id in SolMan
    Re: Do End User Require Login in Solman to raise Support Messages !!
    show to the user there support message list
    e.t.c.
    it is clearly stated: it is possible.
    I have done the next steps:
    In ECC:
    - created a test user
    - assighned him a "sap_all" profile (and "Z_SAP_SV_FDB_NOTIF_BC_CREATE" role) + user comparasion
    - assighned him a "Z_SAP_S_RFCACL" role + user comparasion
    In Solman:
    - No user created
    - In TX DNO_CUST04 the Field Name "NO_USER_CHECK" is maintained with the value "X".
    - In tx BP business partner is created as a general BP, with valid external SYS ID no (other users with both ECC and SM user are OK), and changed to "employee" with ECC username defined.
    Now, the problem is when I try to create a support message as a test user in ECC, I get an error:
    "Error in Local Message System: No authorization to logon as trusted system (Trust Message was Not Created"
    All I could find is the tread:
    solution maanger issue
    and this one is basicly different:
    the mentioned user has both ECC and SM user.
    And one of the answers was the user must have S_RFCACL roles in BOTH ECC ans SM systems...
    In ST22 (in solman) I get error description:
    " An RFC call (Remote Function Call) was sent with the invalid user ID
      "TEST_T01230 "
    . Or the calling system is not registered as trusted system in the
    target system."
    Now, the calling system IS regged as a trusted sys (as I mantioned - other users with both ECC and SM users can send supp. msgs)
    So -  the only answer is "invalid user ID".
    The short message is
    " No authorization to logon as trusted system (Trusted RC=0)"
    and  the trusted return codes ( 0 ) have the following meaning:   Invalid logon data (user ID and client) for the trusting system.
    So. how can I perform trusted Logon with no user in SM?
    Thank you in advance,
    cheers
    Nenad

    Hi again,
    thank you for your help.
    At first I thought you meant *_back dest. directly in SM, and now I see you ment to use SMSY to go to ECC sys, and maintain the RFC conns on ECC diredtly from SMSY, "clean-up RFC Destinations". Yes, can do
    So:
    The problem is solved.
    I deleted the *_back user from ECC to SM, and re-generated the connection with default system pre-defined user SMB_T01. (it is interesting that SU01 reports - user SMB_T01 does not exist)
    I even deleted a SRFCACL role from the test user in ECC, and the user was still able to create the support message (certanly he was, as he uses a *:back rfc with SMB_T01to log on to SM)
    So, resume:
    To be able to create / send a support message from another system, with no user in SolMan, it is needed:
    - a user in other system with roles needed for everyday work, +  "Z_SAP_SV_FDB_NOTIF_BC_CREATE" role;
    - a not trusted SM_<SID>CLNT<CLNT_NB>_BACK rfc connection from satelite system to SolMan, with defined logon user (with apropriate authorisations) - generated by the system.
    -  the BCOS_CUST table in ECC system should be onfigured like: OSS_MSG W SM_<SID>CLNT<CLNT_NB>_BACK CUST 620 1.0
    - a Business Partner for user in SM with identification number for system from where the massege will be sent from. (the user can send the note with out this condition, but the "created by" field in message will be empty in that case)
    Once again thank you,
    cheers,
    Nenad
    Case closed.
    Edited by: Nenad nikolic on Mar 23, 2010 10:54 AM
    Edited by: Nenad nikolic on Mar 23, 2010 10:57 AM

  • Restriction of creating p.o with refe. to service P.R

    Dear cons
        There is no restriction of creating service P.O with reference to service P.R in our company. That means we can create as many number of ser. P.O under one P.R. In case of material P.R restiction has been activated.how can we solve the problem in service P.R.

    HI,
    You mean to say, You want to have the restriction to the servive PO also.
    How you have activated to the material PO. Is it with the help of BADI or any thing else.
    The same you can make use along with doc type you are using for the service PO.
    If I understood wrongly pl let me know.
    regards,
    Kannaiah Naidu

  • Troubles creating a form with Acrobat

    I have created a form with Acrobat 9 Pro. However, when it is brought up with Acrobat Reader, the following message appears:
    Sending data files by email: Please note, this form contains an email submit button. Clicking this button will email a data file... However, the form itself will not be sent. Remember you cannot save a complete file of this form with Adobe Reader 9.
    When the submit button is clicked, the following message is posted on a popup window.
    Operation not permitted.
    Here's the link to a form I am trying to get to work. It works fine if I use the Pro version, but the Reader version doesn't want to allow the form to be sent. http://www.drugfreedekalbcounty.info/pdf/interventionscholarshipform.pdf
    Any help would be appreciated. Thanks.

    It may have been improved with AA9, but at least up through AA8, Acrobat required the use of MAPI on the machine to deal with e-mail. If that has changed, then the other recommendation to use extended rights might meet your need. There is a 500 use limitation for the extended rights (more requires negotiation with Adobe). This may be a limitation that changed with AA9 Pro Extended.
    The rights are not needed if the data file is sent and not the whole PDF. There is no need for the whole PDF since the data file can be opened in the original form document - giving the same result. Your observation that it works in AA9 for e-mail is making the assumption that everyone uses AA9. That is a dangerous assumption if you are developing a general use form. You should assume folks have back to AA7, or even AA5 (like I have on this machine). There are still a few that check in here on occasions with AA4. I have not seen an AA3 question for several years. Thus backward compatibility may be an issue, depending on your client base.
    The cleanest way to work with forms is to submit to a web script. Then there is no question about the end result. The use of web scripts is even recommended for online html forms for much the same reasons. I was giving a heads up so that you have considered possible users that do not have the newest and best, assuming that the latter resolves the e-mail issue.

  • Example of a source file for Creating general maintenance task list

    Hi SAP Gurus,
    I need to create general maintenance task list from a source file. Reading forums i found that it is possible by using LSMW, with object 0490 and method 0000.
    However, I don't know how to associate structure IBIPTLST, IBITLOP and IBIPMAT. When i assign individual source files for each structure, and I execute LSMW, a problem appears indicating that IBITLOP don't have all the required fields from the list header.
    This is the structure propose by SAP in standar programa IBIP.
    Structure - IBIPTLST     Task list header
    |-->>  IBIPTEXT  (see comment below)
       |-->>  IBIPTLOP   Operations
    |       |-->> IBIPTEXT  (see comment below)
       |       |-->> IBIPTMAT  Material for one operation
       |       |-->> IBIPPRTS  Production resources/tools (PRT
       |                   |-->> LONGTEXT  (see comment below)
       |       |-->  IBIPMPAC  Maintenance packages (up to 32)
       |--->> IBIPBDCD (see comment below) from operation overview
    In other forums, a possible solution is to define an unique source file, that is proposed by LSMW, but i don't know how to obtain this template.
    Can you send me an excel example of how to define de input file or the steps I have to follow in order to execute an LSMW or the standard transaction IBIP?.
    My e-mail is [email protected]
    I have read all the SAP documentation, what i really need is an example.
    Thanks a lot
    Andrés.

    solved

  • Error with chart series

    Hi everyone!
    I have a problem with charts with multiple series.
    If the series are incomplete (with lacks of data for some columns), the values lose the right correspondence with the column.
    How can I deal with this?
    Thank so...
    DrPlexi
    Maybe an example would be clarifying, i attach here the xml data and two charts' xml:
    <ROWSET>
    <ROW>
    <series>5</series>
    <col_names>300C</col_names>
    <values>71.91701276542868</values>
    </ROW>
    <ROW>
    <series>3</series>
    <col_names>300C</col_names>
    <values>20.48012540803013</values>
    </ROW>
    <ROW>
    <series>Wagon</series>
    <col_names>300C</col_names>
    <values>7.600472191820757</values>
    </ROW>
    <ROW>
    <series>2</series>
    <col_names>300C</col_names>
    <values>0.0023896347204366342</values>
    </ROW>
    <ROW>
    <series>5</series>
    <col_names>DODGE</col_names>
    <values>65.13503987886224</values>
    </ROW>
    <ROW>
    <series>Wagon</series>
    <col_names>DODGE</col_names>
    <values>15.728327698513192</values>
    </ROW>
    <ROW>
    <series>2</series>
    <col_names>DODGE</col_names>
    <values>14.781938987298812</values>
    </ROW>
    <ROW>
    <series>3</series>
    <col_names>DODGE</col_names>
    <values>4.354693435325753</values>
    </ROW>
    <ROW>
    <series>5</series>
    <col_names>HUMMER</col_names>
    <values>43.14889344162732</values>
    </ROW>
    <ROW>
    <series>Wagon</series>
    <col_names>HUMMER</col_names>
    <values>27.14205893546898</values>
    </ROW>
    <ROW>
    <series>2</series>
    <col_names>HUMMER</col_names>
    <values>13.45361200411366</values>
    </ROW>
    <ROW>
    <series>3</series>
    <col_names>HUMMER</col_names>
    <values>8.480779975868687</values>
    </ROW>
    <ROW>
    <series>4</series>
    <col_names>HUMMER</col_names>
    <values>7.7746556429213465</values>
    </ROW>
    <ROW>
    <series>5</series>
    <col_names>CHEVY</col_names>
    <values>74.89464972938943</values>
    </ROW>
    <ROW>
    <series>3</series>
    <col_names>CHEVY</col_names>
    <values>25.105350270610575</values>
    </ROW>
    <ROW>
    <series>3</series>
    <col_names>CADILLAC</col_names>
    <values>39.497342869700724</values>
    </ROW>
    <ROW>
    <series>5</series>
    <col_names>CADILLAC</col_names>
    <values>64.38519904375845</values>
    </ROW>
    <ROW>
    <series>Wagon</series>
    <col_names>JEEP</col_names>
    <values>60.66246011233522</values>
    </ROW>
    <ROW>
    <series>5</series>
    <col_names>JEEP</col_names>
    <values>39.33753988766478</values>
    </ROW>
    </ROWSET>
    And here's the xml of two charts (both showing wrong results):
    chart:
    <Graph graphType="LINE_VERT_ABS">
    <Title text="" visible="true" horizontalAlignment="CENTER"/>
    <LocalGridData colCount="{count(xdoxslt:group(.//ROW, 'col_names'))}" rowCount="{count(xdoxslt:group(.//ROW, 'series'))}">
    <RowLabels>
    <xsl:for-each-group xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select=".//ROW" group-by="series">
    <Label>
    <xsl:value-of select="current-group()/series"/>
    </Label>
    </xsl:for-each-group>
    </RowLabels>
    <ColLabels>
    <xsl:for-each-group xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select=".//ROW" group-by="col_names">
    <Label>
    <xsl:value-of select="current-group()/col_names"/>
    </Label>
    </xsl:for-each-group>
    </ColLabels>
    <DataValues>
    <xsl:for-each-group xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select=".//ROW" group-by="series">
    <RowData>
    <xsl:for-each-group select="current-group()" group-by="col_names">
    <Cell>
    <xsl:value-of select="sum(current-group()/values)"/>
    </Cell>
    </xsl:for-each-group>
    </RowData>
    </xsl:for-each-group>
    </DataValues>
    </LocalGridData>
    </Graph>
    chart:
    <Graph type="BAR_VERT_PERCENT">
    <Title text="" visible="true" horizontalAlignment="CENTER"/>
    <LocalGridData colCount="{count(xdoxslt:group(.//ROW, 'col_names'))}" rowCount="{count(xdoxslt:group(.//ROW, 'series'))}">
    <RowLabels>
    <xsl:for-each-group xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select=".//ROW" group-by="series">
    <Label>
    <xsl:value-of select="current-group()/series"/>
    </Label>
    </xsl:for-each-group>
    </RowLabels>
    <ColLabels>
    <xsl:for-each-group xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select=".//ROW" group-by="col_names">
    <Label>
    <xsl:value-of select="current-group()/col_names"/>
    </Label>
    </xsl:for-each-group>
    </ColLabels>
    <DataValues>
    <xsl:for-each-group xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select=".//ROW" group-by="series">
    <RowData>
    <xsl:for-each-group select="current-group()" group-by="col_names">
    <Cell>
    <xsl:value-of select="sum(current-group()/values)"/>
    </Cell>
    </xsl:for-each-group>
    </RowData>
    </xsl:for-each-group>
    </DataValues>
    </LocalGridData>
    </Graph>

    I was having the same error while trying to plot a moving average across 7 days. The work around I found was rather simple.
    If you right click your report in the solution explorer and select "View Code" it will give you the underlying XML of the report. Find the entry for the value of your calculated series and enter a formula to dynamically create your periods.
    <ChartFormulaParameter Name="Period">
                      <Value>=IIf(Count(Fields!Calls.Value) >= 7 ,7, (Count(Fields!Calls.Value)))</Value>
    </ChartFormulaParameter>
    What I'm doing here is getting the row count of records returned in the chart. If the returned rows are greater than or equal to 7 (The amount of days I want the average) it will set the points to 7. If not, it will set the number to the amount of returned rows. So far this has worked great. I'm probably going to add more code to handle no records returned although in my case that shouldn't happen but, you never know.
    A side note:
    If you open the calculated series properties in the designer, you will notice the number of periods is set to "0". If you change this it will overwrite your custom formula in the XML.

  • How do I create a dropdown with three options so that only one is visible in a form (non-flowable)

    I'm working on a form which needs to provides three options for the user out of a drop down list. When the user chooses one option, only that subform is to be visible. Two of the three subforms are text fields, and the third subform is a series of fields which are editable by the user.
    How do i create a dropdown with three options in it, so that in each instance only one subform is visible? This needs to happen in the same space on the main form.

    Hi Nellie,
    Here is the form back to you. There were three main issues:
    In order for dynamic behaviour, like showing and hiding, the form must be saved as a Dynamic XML Form in the save-as dialog.
    While you can use a minus sign when naming objects and subforms, it will cause scripts to fail. I have changed the name of the subforms so that they now use an underscore.
    The dropdown had specified values in the Object > Binding palette (1, 2, 3), so the script needs to use these in the if statements.
    When sharing forms on Acrobat.com, the best option is to select the file in your workspace and then click Publish. This will make it available to anyone who has the published URL.
    I hope that helps,
    Niall

  • How to create a stage with tabs?

    I tested this code to create a stage with tabs:
    {code}
    public void GeneralConfiguration()
            Stage configurationStage = new Stage();
            configurationStage.setTitle("General Settings");
            configurationStage.initModality(Modality.WINDOW_MODAL);
            Group grid = new Group();
            TabPane tabPane = new TabPane();
            //Create Tabs
            Tab tabA = new Tab();
            tabA.setText("Main Component");
            tabA.setClosable(false); // da se mahne opciqta da se zatvarq tab
            //Add something in Tab
            StackPane tabA_stack = new StackPane();
            tabA_stack.setAlignment(Pos.CENTER);
            tabA_stack.getChildren().add(new Label("Label@Tab A")); // dobavq se tuka accordion
            tabA.setContent(tabA_stack);
            tabPane.getTabs().add(tabA);
            Tab tabB = new Tab();
            tabB.setText("Second Component");
            tabB.setClosable(false); // da se mahne opciqta da se zatvarq tab
            //Add something in Tab
            StackPane tabB_stack = new StackPane();
            tabB_stack.setAlignment(Pos.CENTER);
            tabB_stack.getChildren().add(new Label("Label@Tab B"));
            tabB.setContent(tabB_stack);
            tabPane.getTabs().add(tabB);
            Tab tabC = new Tab();
            tabC.setText("Last Component");
            tabC.setClosable(false); // da se mahne opciqta da se zatvarq tab
            //Add something in Tab
            StackPane tabC_vBox = new StackPane();
            tabC_vBox.setAlignment(Pos.CENTER);
            tabC_vBox.getChildren().add(new Label("Label@Tab C"));
            tabC.setContent(tabC_vBox);
            tabPane.getTabs().add(tabC);
            //grid.add(tabPane);
            grid.getChildren().add(tabPane);
            // Configure dialog size and background color
            Scene Scene = new Scene(grid, 800, 600, Color.WHITESMOKE);
            configurationStage.setScene(Scene);
            configurationStage.show();
    {code}
    Can you tell me how I can fill the stage with the tabs body. Now I get this result:
    http://i44.tinypic.com/2zppcg4.png

    Use some kind of managed layout pane instead of a group for the root. I like to use a BorderPane or AnchorPane as the root container:
    // Group grid = new Group();
    BorderPane grid = new BorderPane();
    // grid.getChildren().add(tabPane);
    grid.setCenter(tabPane);
    Message was edited by: James_D (Figured out how to post code!)

  • How to create a demo with time limit?  (timebomb)

    Hello,
    I would like to create a demo of a game I made but want to limit the amount of time it will run once installed.  (30 days).
    Is there an xtra or a straightforward way to do this in lingo?

    there is no straightforward way to do it in any programming language. I'm currently developing a Director-specific trial version solution, but it's not ready yet for general/commercial use. Are you looking for a free solution or are you willing to pay?
    Trial Versions are used so users can try out your software and then buy it if the software is something they want. So, there are two parts to trial software;
    1. the code that handles the trial version
    2. the code that handles the product serial and registration/licence keys
    The code that handles the trial version needs to be able to do these things:
    1. Keep track of the trial period. This involves recording the first run date/time and incrementing that date/time when the software is launched each subsequent time and comparing that against the trial period.
    2. Protect against backdating - turning back the computer clock to get more trial time.
    3. Protect against uninstall/reinstall.
    Dealing with all three of these issues becomes complicated; let's look at a solution using a licence file. What about a licence file will solve all the issues listed above?
    1. The licence file will contain the First Run Date (FRD), the Last Run Date (LRD), and other specific user and product info.
    2. A licence file should be encrypted to ensure it cannot be tampered with.
    3. A licence file should be moved to the user's AppData (or equivalent) folder by the installer software (such as NSIS). This ensures the first run date is only ever recorded once... what do I mean by this? If your app had to check first before opening and writing to the license file, then someone could easily circumvent the trial version by deleting the file at which point your application would be forced to move/write the licence file again and the user would be able to start the trial over again. Well, the installer only ever runs once. So, if it copies over the licence file during the installation process then our application, when it runs the first time, only has to check if the file is there; if not then the trial has been tampered with, if it's there then read the FRD, and if blank then we can be sure it's writing the FRD for the first and only time.
    4. The file could be hidden to ensure that an un/reinstallation of your software wouldn't circumvent your trial security. Another method is to write to the registry some entry that's obscure or looks like some other info for your software... this is what's called security by obscurity which is frowned upon in the industry, in general, but there's really no way around it in the case of trial software methods.
    5. A licence file can be used as a red-herring if you want to use an obscure/hidden registry entry to save the real trial version information. If that's the case, you should follow the same steps as above and have your installer write the initial registry entries so it cannot be as easily circumvented by your code checks.
    Encryption is a big part of trial version security. If you're using MX2004 or above then you can find javascript ports of some strong encryption algorithms such as AES or RSA. RSA is an asymmetrical (ie public/private key) encryption algorithm whereas AES is a symmetrical (ie. private key) algorithm. The important things to look for in an implementation are ones that will encrypt a variable length string. These implementations use modes to encrypt fixed length chunks of the string, thus making the core encryption algorithm useful in practical situations such as encrypting variable length strings.
    Creating a trial/registration .dir file (trial window) that gets published with the main application .dir file:
    Below, I've outlined these steps so you can see what I mean. I've tested this process and it's solid, AFAIK. Here are the steps:
    1. Create a project and name it movie1. Add a framescript with the 'go the frame' code on it.
    2. Add a label named 'continue' on the frame just after the 'go the frame' framescript.
    3. Add a button, and this code:
    go to frame "continue"
    4. Now, go into the Publish Settings options and go to the 'Files' tab and add any of your other .dir files you want under the 'Additional Files:' heading (the option to Play every movie in list will be checkmarked by default. Leave it like that).
    5. Now, Publish your project and you will have ONE .exe called movie1.exe which contains two .dir files that have been published.
    6. Open your User Temp folder and observe the folder that's created when you run movie1.exe... no temp .dir file is created when you run movie1.exe
    7. Creating another .dir with this code:
    go to frame "continue" of movie("movie1")
    ...does not work as it's looking for a .dir or .dxr or .dcr and will not work with an .exe.
    What this means is you can create a single executable that runs the trial window with all your trial version code and if everything checks out in the licence file then you can go to the main application movie. The trial window can be used to display the trial information, including a registration section, if you like. Google examples of trial version software to get ideas of what should be included in a trial version display.
    Resources:
    AES encryption written in Javascript: http://www.movable-type.co.uk/scripts/aes.html
    DOUG Article I wrote on creating product keys: http://director-online.com/forums/read.php?2,22279,22303#msg-22303
    Block Cipher Modes: http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Counter_.28CTR.29
    AES - Wikipedia: http://en.wikipedia.org/wiki/Advanced_Encryption_Standard
    RSA - http://en.wikipedia.org/wiki/RSA
    Pseudocode for recording and comparing dates
    FRD = First Run Date
    LRD = Last Run Date -- this one would get updated every time the app was run.
    CRD = the systemDate
    NumDays = 30 -- the number of days for trial version
    dateGood = False
    If LRD > CRD Then
    -- the system clock was rolled back
    dateGood = False
    Else If (the systemDate) > (NumDays + FRD) Then
    -- trial version has expired
    dateGood = False
    Else If CRD > LRD Then
    -- everything is ok, so write a new LRD date in registry or wherever else
    dateGood = True
    Else If CRD = (_movie.systemDate) Then
    -- the dates are both good
    dateGood = True
    Else
    dateGood = False
    End If
    Typical Place to Write Application data to the Registry:
    HKCU\Software\<AppName>\<version>\
    eg. HKCU\Software\TRiShield\1.0\

  • Need to create a report with drop down option

    Hi,
    I have created a report with a simple query. Its a real time report.
    select host_name, target_name, instance_name from MGMT$DB_DBNINSTANCEINFO
    where target_type = 'oracle_database';
    It gives me a tabular report. It works fine. But it is a huge report about 1000 rows. We can see a particular number of rows per page. Thats fine.
    I need something else. I will select a particular target name from a drop down and the report will give me the result for the respective target only. Is that possible ? How to do that ?
    Thanks in Advance

    Hello,
    When you create your report, in the "general" tab, under Targets click on the first radio button named "A target will be selected by the report viewer when viewing the report" and under that choose target type="Database Instance".
    Then in your report query, use the predefined variable ??EMIP_BIND_TARGET_GUID?? to identify the target the report user will select at execution time; for instance:
    select host_name, target_name, instance_name from MGMT$DB_DBNINSTANCEINFO
    where target_type = 'oracle_database' and target_guid=??EMIP_BIND_TARGET_GUID?? ;
    regards,
    Noel

Maybe you are looking for

  • How to delete duplicate records in cube

    Hi, can u help me how to delete the duplicate records in my cube and tell me some predifined cubes and data sourcess for MM and SD modules

  • How to compile a single file in a project

    I have placed my java connector file called "xxxTargetconnector .class" in the below mentioned path D:\FSCM9DMO\webserv\FSCMDMO9\applications\peoplesoft\PSIGW\WEB-INF\classes\com\peoplesoft\pt\integrationgateway\targetconnector I have converted the a

  • Time for a new Mac or just a new graphics card?

    My dual core Mac Pro is getting sluggish with Motion.  I was thinking of picking up a new iMac and loading it up with RAM but after reading a bit about the importance of graphics cards in Motion (Spencer's article is linked below) and the benefits of

  • How can I click to hande OVS and Search help for Web Dynpro

    Once the F4 help is clicked,  the event OVS of IF_WD_VALUE_HELP_FORWARD is triggered. Here  I would like to change the value list of F4 help list, I implemented a class and a method that handle that event. Since event only has importing parameter, ho

  • How can 35MM Slides be transfered to DVD?

    I have 100's of slides that need to be transfered to DVD's, &/or iDVD, &/or iPhoto.... A transfer device is available for PC's but is there an affordable transfer device for Mac users???