Boolean counting short program

Hi. I'm on day 2 of Java - and day 2 to programing in general-so please bear with me. I'm trying to write a short program using the IsPrime method to count primes from 1-500. Below is what I've written. The class is listed below that and then the error message that results. Any help would be appreciated.
public class Prime {
public static void main (String[] arguments) {
     final int LIMIT = 500
          int count = 0
          do
          System.out.println (count);
          count++
     while (count <LIMIT)
int number = input.nextInt();
Prime p = new Prime();
boolean isPrime = isPrime(number);
if (isPrime == true)
System.out.println("%d is Prime...500", number);
else
System.out.println("%d is not Prime...500", number);
class Prime
public boolean isPrime( int number ) {
for (int factor = 2; factor <= Math.sqrt(number); factor++)
if (number % factor == 0)
return false;
return true;
C:\J21work>javac 2assignment07.java
2assignment07.java:5: ';' expected
int count = 0
^
2assignment07.java:10: ';' expected
while (count <LIMIT)
^
2 errors

Hi,
I found some of the errors mentioned above, and I believe I found some others as well.
1) Your first posting of code shows you declaring the class Prime twice, was this just an oversight when you posted? If not, move the isPrime() method into the first definition of class Prime(), this is the easiest way to achieve what you want (i.e. not having to instantiate a class, etc).
2) You had what appears to be a call to the scanner class in
input.nextInt();but I didn't see where you created an object of Scanner. Maybe I am missing something, but I don't think that will compile, will it?
3) As noted above, you need ';' terminating your lines. Also, not required, but I find it extremely helpful to place all code inside of if blocks within {}. This is only required when there are multiple lines of code within the block, but having them makes debugging so much easier.
I touched up hyour code a bit, I'm no expert, but it works.... let me know if you have any questions.
import java.util.Scanner; //In order to access the Scanner class you need to import it first
public class Prime {
     public static void main (String[] arguments) {
          final int LIMIT = 10;
          int count = 0;
          Scanner keyboard = new Scanner(System.in);
          do{
               System.out.println (count);
               count++;
          }while (count <LIMIT);
          System.out.println("Enter a prime number:"); //When requring console input, alwasy prompt the user
          int number = keyboard.nextInt();
          if (isPrime(number)) { //Curly braces are your friend....
               System.out.printf("%d is Prime...500", number);
          else {
               System.out.printf("%d is not Prime...500", number);
     public static boolean isPrime( int number )
          for (int factor = 2; factor <= Math.sqrt(number); factor++) //Not sure about ><= you had here....
               if (number % factor == 0)
                    return false;
               return true;
          return false;
}

Similar Messages

  • How to pass IN parameter as BOOLEAN for concurrent program in Apps(Environ)

    hi all
    i am using a standard package procedure,where in which i need to pass some parameters to a procedure,
    some of the parameters there are BOOLEAN type ,can anybody help me to know , How to pass IN parameter as BOOLEAN for concurrent program in Apps(Environ)

    Already answered this on the SQL forum (How to give IN parameter as BOOLEAN in a concurrent program.

  • Pl/sql boolean expression short circuit behavior and the 10g optimizer

    Oracle documents that a PL/SQL IF condition such as
    IF p OR q
    will always short circuit if p is TRUE. The documents confirm that this is also true for CASE and for COALESCE and DECODE (although DECODE is not available in PL/SQL).
    Charles Wetherell, in his paper "Freedom, Order and PL/SQL Optimization," (available on OTN) says that "For most operators, operands may be evaluated in any order. There are some operators (OR, AND, IN, CASE, and so on) which enforce some order of evaluation on their operands."
    My questions:
    (1) In his list of "operators that enforce some order of evaluation," what does "and so on" include?
    (2) Is short circuit evaluation ALWAYS used with Boolean expressions in PL/SQL, even when they the expression is outside one of these statements? For example:
    boolvariable := p OR q;
    Or:
    CALL foo(p or q);

    This is a very interesting paper. To attempt to answer your questions:-
    1) I suppose BETWEEN would be included in the "and so on" list.
    2) I've tried to come up with a reasonably simple means of investigating this below. What I'm attempting to do it to run a series of evaluations and record everything that is evaluated. To do this, I have a simple package (PKG) that has two functions (F1 and F2), both returning a constant (0 and 1, respectively). These functions are "naughty" in that they write the fact they have been called to a table (T). First the simple code.
    SQL> CREATE TABLE t( c1 VARCHAR2(30), c2 VARCHAR2(30) );
    Table created.
    SQL>
    SQL> CREATE OR REPLACE PACKAGE pkg AS
      2     FUNCTION f1( p IN VARCHAR2 ) RETURN NUMBER;
      3     FUNCTION f2( p IN VARCHAR2 ) RETURN NUMBER;
      4  END pkg;
      5  /
    Package created.
    SQL>
    SQL> CREATE OR REPLACE PACKAGE BODY pkg AS
      2 
      3     PROCEDURE ins( p1 IN VARCHAR2, p2 IN VARCHAR2 ) IS
      4        PRAGMA autonomous_transaction;
      5     BEGIN
      6        INSERT INTO t( c1, c2 ) VALUES( p1, p2 );
      7        COMMIT;
      8     END ins;
      9 
    10     FUNCTION f1( p IN VARCHAR2 ) RETURN NUMBER IS
    11     BEGIN
    12        ins( p, 'F1' );
    13        RETURN 0;
    14     END f1;
    15 
    16     FUNCTION f2( p IN VARCHAR2 ) RETURN NUMBER IS
    17     BEGIN
    18        ins( p, 'F2' );
    19        RETURN 1;
    20     END f2;
    21 
    22  END pkg;
    23  /
    Package body created.Now to demonstrate how CASE and COALESCE short-circuits further evaluations whereas NVL doesn't, we can run a simple SQL statement and look at what we recorded in T after.
    SQL> SELECT SUM(
      2           CASE
      3              WHEN pkg.f1('CASE') = 0
      4              OR   pkg.f2('CASE') = 1
      5              THEN 0
      6              ELSE 1
      7           END
      8           ) AS just_a_number_1
      9  ,      SUM(
    10           NVL( pkg.f1('NVL'), pkg.f2('NVL') )
    11           ) AS just_a_number_2
    12  ,      SUM(
    13           COALESCE(
    14             pkg.f1('COALESCE'),
    15             pkg.f2('COALESCE'))
    16           ) AS just_a_number_3
    17  FROM    user_objects;
    JUST_A_NUMBER_1 JUST_A_NUMBER_2 JUST_A_NUMBER_3
                  0               0               0
    SQL>
    SQL> SELECT c1, c2, count(*)
      2  FROM   t
      3  GROUP  BY
      4         c1, c2;
    C1                             C2                               COUNT(*)
    NVL                            F1                                     41
    NVL                            F2                                     41
    CASE                           F1                                     41
    COALESCE                       F1                                     41We can see that NVL executes both functions even though the first parameter (F1) is never NULL. To see what happens in PL/SQL, I set up the following procedure. In 100 iterations of a loop, this will test both of your queries ( 1) IF ..OR.. and 2) bool := (... OR ...) ).
    SQL> CREATE OR REPLACE PROCEDURE bool_order ( rc OUT SYS_REFCURSOR ) AS
      2 
      3     PROCEDURE take_a_bool( b IN BOOLEAN ) IS
      4     BEGIN
      5        NULL;
      6     END take_a_bool;
      7 
      8  BEGIN
      9 
    10     FOR i IN 1 .. 100 LOOP
    11 
    12        IF pkg.f1('ANON_LOOP') = 0
    13        OR pkg.f2('ANON_LOOP') = 1
    14        THEN
    15           take_a_bool(
    16              pkg.f1('TAKE_A_BOOL') = 0 OR pkg.f2('TAKE_A_BOOL') = 1
    17              );
    18        END IF;
    19 
    20     END LOOP;
    21 
    22     OPEN rc FOR SELECT c1, c2, COUNT(*) AS c3
    23                 FROM   t
    24                 GROUP  BY
    25                        c1, c2;
    26 
    27  END bool_order;
    28  /
    Procedure created.Now to test it...
    SQL> TRUNCATE TABLE t;
    Table truncated.
    SQL>
    SQL> var rc refcursor;
    SQL> set autoprint on
    SQL>
    SQL> exec bool_order(:rc);
    PL/SQL procedure successfully completed.
    C1                             C2                                     C3
    ANON_LOOP                      F1                                    100
    TAKE_A_BOOL                    F1                                    100
    SQL> ALTER SESSION SET PLSQL_OPTIMIZE_LEVEL=0;
    Session altered.
    SQL> exec bool_order(:rc);
    PL/SQL procedure successfully completed.
    C1                             C2                                     C3
    ANON_LOOP                      F1                                    200
    TAKE_A_BOOL                    F1                                    200The above shows that the short-circuiting occurs as documented, under the maximum and minimum optimisation levels ( 10g-specific ). The F2 function is never called. What we have NOT seen, however, is PL/SQL exploiting the freedom to re-order these expressions, presumably because on such a simple example, there is no clear benefit to doing so. And I can verify that switching the order of the calls to F1 and F2 around yields the results in favour of F2 as expected.
    Regards
    Adrian

  • Booleans to control programming flow

    Is it ok to use booleans within an object to control program flow in an Object Oriented approach?
    For eg: I have 2 tables in the database which are related. Some times both the tables need to be updated, other times, just 1 table.
    One approach would be to have 2 separate methods in the Data Acces object which handle these situtions, as this seems to be cleaner. However, another approach would be to send all the data along with a boolean to the Data Access Object and let the Data Access object make the decision of which tables to update by checking the boolean.
    Please tell me which approach is better and more Object oriented.

    1. How often will the Two tables be updated together.(Not a major factor)
    2. Keep both methods you mentioned.
    3. Create a new method that takes the boolean and the data to update.
    and use this in it:
        (boolean)?FirstMethod:SecondMethod;
       If boolean is true then it calls FirstMethod else SecondMethod.
    Anyone else think of anything?

  • Boolean Counter and Reset

    Hello,
    I would like to create a LabVIEW counter display which increments with every boolean click (i.e. user input, Start button). Each boolean click is currently running one cycle of my test i.e. in a State Machine. So far, the counter increments with each click correctly.
    Problem: I haven't found a way to reset the counter at will. I would like to reset this counter when the user selects a Stop button.
    PS: I dont have Event Structures since im using LV Base. Your help will be appreciated, thanks!
    Solved!
    Go to Solution.

    Looks to me like you're making it much more complicated than it needs to be.  That loop in the first post doesn't do anything and the un-initialized shift register could cause a problem.
    Here's an easy way which I think will work for you:
    Basically, there are just two buttons.  If Increment is pressed, it adds 1 to the current value.  If Reset is pressed, it sets the value back to zero.  In this configuration, Reset over-rules Increment.
    Attachments:
    Increment-Reset.jpg ‏18 KB

  • MyRIO counting short pulses

    Hello All,
    I am using a NI myRIO and want to count square wave pulses with rather short duty cycles (less than 20%).  I have set up a VI that does a digital read on the proper pins, but it is missing many of the pulses.  Does anyone have a suggestion for how to catch all of these quick pulses without actually inserting hardware to make the duty cycle longer.
    Thank you so much.
    Attachments:
    Main.vi ‏186 KB
    Simple Edge Detection.vi ‏9 KB

    200us equates to roughly 5kHz minimum. Of course, you could still miss the pulse by sampling at even 10k (nyquist minimum) as the edges could possibly be missed. It would be good to sample 4 times faster than the 200us edge to get a valid reading. To do this, you will need to write some LabVIEW FPGA code. Currently, you are using the DI Express VI which runs onthe Real-Time (RT) OS. Even though the hardware (the FPGA) can sample very fast, the RT loop rate is the limiting factor. 
    There is examples in the example finder for counting edges in LabVIEW FPGA. If you navigate to Example Finder » Hardware Input and Output » CompactRIO » FPGA Fundamentals » Counters » Event Counters, you can find several good examples. Here is a screenshot of one:
    Tannerite
    National Instruments

  • Boolean counting?

    Good morning, I'm a novice to Labview so take it easy on me. What I'm trying to do is: Run a while loop after 1 true, 1 false and 1 true boolean. I'm trying to start a measurement when a digital input off a TTL goes high the second time, so I can get a good zero reading. I've searched the forums but can't get a grasp on what I'm doing exactly. Any help would be greatly appreciated.
    Solved!
    Go to Solution.

    here it is!
    Attachments:
    digital out.vi ‏76 KB

  • A short programing question???

    Hi guys...
    I am a programer and have not worked much but I got this offer from a company to design their web site.
    The web site will have to do with creating this servise where people can login and check their phone calls made (the data which I will get an access to)and display it on their browser.
    The web site will need to have options on how the user wants their samples file to be displayed.
    So in other words, I know that this forum is mainly for java programing problems but I was wondering if you guys could please tell me how much should I charge them, Cause I have no idea on how much the projects cost on the main programmers trend.

    You need to know / guess how much money this will make / save the company and base your fee on that.
    A small company may be happy with a return on investment of 6-12 months so you should look to charge them the amount of money they will make / save by using your design in 6-12 months
    its all about managing the customers expectations and getting away with charging what you can

  • Short program to write, but I can't understand the instructions...

    [http://www.cs.memphis.edu/~asnegatu/comp2701/Labs/2701ProgAssgn-3.html]
    I can choose to do either one, and the second looks easier, so I'll do it.
    I just don't know what he's asking for..
    Is he asking for me to use a scanner and get a number from the user, and find the probability of choosing that ONE number from the set of 10, 100,1000,10000,100000. Or is is something else?
    He says "find the probability of selecting the six integers from the set {1, 2, ..., n} that were mechanically selected in a lottery." But I don't know what six integers he's talking about. there are 5 different sets of integers, not six.
    and it says given a positive integer n, yet he has n=10, 100,1000, etc in the example...

    Taco_John wrote:
    he doesn't reply to emails quick enough (it's due in 3 hours)Well, that's the price you pay for waiting too long to start. Couldn't you have gone to ask him these questions in person?
    find the probability of selecting the six integers from the set {1, 2, ..., n}
    I know what "from the set...etc" means.It says find the probability of selecting THE six integers.
    What six integers? If i choose 19 to be n, what 6 numbers? 4 5 6 7 8 9, or 1 3 5 7 8 16?The numbers that were chosen by whatever method the lottery uses to pick its numbers (I'd think it's safe to assume all numbers are equally likely to be picked). It's poorly worded.

  • Am I required to program the initial count each time the tc is passed?

    I would like the counter to always use the same initial count, without programming a loop.

    Ah I see now. In this case their is an easier way to go about this. Use the second counter also in continuous pulse train generation mode. Only use the output from your first counter (the one that is driving the stepper motor) as it's source. By default, the output mode will toggle, but you can change the mode to pulsed output. (Such that at the end of each pulse spec you will get a short pulse) I am not sure which development environment you are using, but the Pulse Train Generation on a 660X Device with Pulsed Output Mode example shows how this is done. It's basic
    ally the same in LabVIEW too. You use the Set Attribute VI to change the output mode to "pulse." The counter will pulse at the end of each "pulse spec" register.
    I hope I'm making sense. Let me know if I'm not.
    Russell
    Applications Engineer
    National Instruments
    http://www.ni.com/support

  • Short-circuiting boolean expressions

    There is a term used in other languages to describe the behavior of compiled code which evaluates boolean expressions: short circuiting. Basically, it means that if a term in an expression determines its value, then following terms never get evaluated, since they are irrelevant. For example, I have noticed that this always works in AppleScript:
    if class of x is not integer or x > 32 then . . . .
    But this will throw an exception if x is something that can’t be coerced into a number:
    if x > 32 or class of x is not integer then . . . .
    It looks to me that the reason the first always works is that Applescript is short-circuiting, and therefore there is no attempt to evaluate the inequality if x is of inappropriate class.
    Does anyone know if Applescript’s behavior is sufficiently well defined that I can be confident it will always short circuit? I know I can avoid the issue by breaking such expressions into separate, nested, if statements. If there is no such assurance that is what I will probably make a habit of doing. But I thought I'd ask if this is really necessary.

    Hello
    Short-circuiting is well-defined in AppleScript.
    cf. ASLG > Operator References (p.179 of ASLG pdf)
    http://developer.apple.com/library/mac/documentation/AppleScript/Conceptual/Appl eScriptLangGuide/AppleScriptLanguageGuide.pdf
    Regards,
    H

  • Can i get script for the standard program 'Generate cycle count requests'

    Actually we have huge records available in *'Cycle count open requests listing'* report and its because of the *'Generate cycle count requests'* program created many records on particular date in mtl_cycle_count_entries table. Can anyone help to provide the script or the logic on what basis the Generate cycle count requests' program retrieving data

    Make sure that toolbars like the "Navigation Toolbar" and the "Bookmarks Toolbar" are visible: "View > Toolbars"
    *Open the Customize window via "View > Toolbars > Customize"
    *Check that the "Bookmarks Toolbar items" is on the Bookmarks Toolbar
    *If the "Bookmarks Toolbar items" is not on the Bookmarks Toolbar then drag it back from the toolbar palette in the customize window to the Bookmarks Toolbar
    **If other missing items are in the toolbar palette then drag them back from the Customize window on the toolbar
    *If you do not see an item on a toolbar and in the toolbar palette then click the "Restore Default Set" button to restore the default toolbar set up
    If the menu bar is hidden then press the F10 key or hold down the Alt key to make the menu bar appear.
    Make sure that toolbars like the "Navigation Toolbar" and the "Bookmarks Toolbar" are visible: "View > Toolbars"
    *Open the Customize window via "View > Toolbars > Customize"
    *Check that the "Bookmarks Toolbar items" is on the Bookmarks Toolbar
    *If the "Bookmarks Toolbar items" is not on the Bookmarks Toolbar then drag it back from the toolbar palette in the customize window to the Bookmarks Toolbar
    **If other missing items are in the toolbar palette then drag them back from the Customize window on the toolbar
    *If you do not see an item on a toolbar and in the toolbar palette then click the "Restore Default Set" button to restore the default toolbar set up

  • Performance counter updating error

    Hello,
    We are getting flooded with alerts event code 106. Is there a problem with the counters. We also get these on our mailbox server also. The servers are exchange 2013 on prem. The we have 2 CAS and 4 mailbox servers. 
    Application:MSExchange Common:106
    Performance counter updating error. Counter name is Client-side Calls, category name is MSExchange Active Manager Client. Option
    Performance counter
    updating error. Counter name is Unique servers queried, category name is MSExchange Active Manager Client. Optional code: 3. Exception: The exception thrown is : System.InvalidOperationException: The requested Performance Counter is no
    Performance counter updating error. Counter name is Client-side Calls, category name is MSExchange Active Manager Client. Optional code: 2. Exception: The exception thrown is : System.InvalidOperationException:
    The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly. at System.Diagnostics.PerformanceCounter.InitializeImpl() at System.Diagnostics.PerformanceCounter.get_RawValue() at Microsoft.Exchange.Diagnostics.ExPerformanceCounter.get_RawValue()
    Last worker process info : System.ArgumentException: Process with an Id of 1832 is not running. at System.Diagnostics.Process.GetProcessById(Int32 processId) at Microsoft.Exchange.Diagnostics.ExPerformanceCounter.GetLastWorkerProcessInfo() Processes running
    while Performance counter failed to update: 7020 splunk-perfmon 588 services 976 svchost 384 TrustedInstaller 1368 svchost 6620 rdpclip 1168 rundll32 1560 inetinfo 5300 XenDpriv 1160 svchost 2144 XenGuestAgent 2340 Microsoft.Exchange.Directory.TopologyService
    8444 conhost 956 LogonUI 2528 w3wp 2724 WmiPrvSE 6884 explorer 5472 nvwmi64 544 winlogon 3104 w3wp 772 nvvsvc 3292 MSExchangeFrontendTransport 2108 WMSvc 7228 w3wp 332 smss 1312 spoolsv 3872 rundll32 4856 WmiApSrv 6704 w3wp 5444 winlogon 3864 svchost 1104
    VSSVC 6404 ccSvcHst 10552 vds 504 csrss 5032 Smc 6804 dwm 696 svchost 496 wininit 4632 rundll32 888 svchost 6600 w3wp 492 w3wp 2264 Ec2Config 1672 MSExchangeHMHost 2064 svchost 9512 splunkd 7972 w3wp 1860 SMSvcHost 872 svchost 5792 csrss 5592 MSExchangeHMWorker
    1452 ruby 1840 svchost 6764 w3wp 1048 svchost 456 csrss 7152 w3wp 1388 bedbg 3996 Microsoft.Exchange.UM.CallRouter 4380 splunk-wmi 2812 WmiPrvSE 2024 ccSvcHst 3792 Microsoft.Exchange.ServiceHost 600 lsass 796 nvwmi64 5756 w3wp 1580 msdtc 2796 svchost 428 svchost
    820 nvSCPAPISvr 1016 svchost 1996 svchost 1600 Microsoft.Exchange.Diagnostics.Service 4356 nvxdsync 4352 taskeng 608 lsm 4936 svchost 2964 beremote 6312 taskhost 1976 svchost 4 System 10640 conhost 0 Idle Performance Counters Layout information: FileMappingNotFoundException
    for category MSExchange Active Manager Client : Microsoft.Exchange.Diagnostics.FileMappingNotFoundException: Cound not open File mapping for name Global\netfxcustomperfcounters.1.0msexchange active manager client. Error Details: 2 at Microsoft.Exchange.Diagnostics.FileMapping.OpenFileMapping(String
    name, Boolean writable) at Microsoft.Exchange.Diagnostics.PerformanceCounterMemoryMappedFile.Initialize(String fileMappingName, Boolean writable) at Microsoft.Exchange.Diagnostics.ExPerformanceCounter.GetAllInstancesLayout(String categoryName)

    Hi,
    Please try the following steps:
    1. Stop all the exchange-related services on the server
    2. Open the command prompt by “Run as an Administrator”
    3. Go to "C:\Program files\Microsoft\Exchange Server\V15\Setup\Perf"
    4. To Unload Counter
    ===============
    C:\Program files\Microsoft\Exchange Server\V15\Setup\Perf>unlodctr "MSExchaneg Active Manager Client"
    5. To Load Counter
    =============
    C:\Program files\Microsoft\Exchange Server\V15\Setup\Perf>lodctr ActiveManagerClientPerfmon.ini
    Then check whether the issue persists. The solution above is referred to the following similar thread:
    https://social.technet.microsoft.com/Forums/exchange/en-US/58692b89-d83e-4f3a-b991-9bb38b8ccad0/performance-counters-update-errors-exchange-active-manager-client-ones?forum=exchange2010
    Regards,
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]
    Winnie Liang
    TechNet Community Support

  • Unreliable Timing in FORTRAN Program

    Could you listen to the following tale and let me know what you think might be happening?
    Three weeks ago (about 2 wks after a reboot) I started an experiment on my Ultra 10 (360Mhz UltraIIi cpu). It was a continuation of an experiment I had been running on a slower machine at Drexel University (250Mhz UltraII cpu). The ratio of speeds on the two machines over the past year and a half has always been about 1.42/1. The experiment on my machine started at a point about 20,000 seconds before the end of the Drexel run. So, just to be sure about the ratio of speeds, I examined the repeated segment and compared the runtimes. (To do timing I use internal calls to the SYSTIM subprogram which provides intermediate elapsed time to write into the program output.)
    Surprisingly, the ratio of speeds was 0.97/1 (really horrible). I checked my cpu occupancy and swapping/paging using 'tops' and 'vmstat' and could find nothing unusual. My program needs about 45M of RAM for scratch arrays. However, tops indicates that of the 256M of RAM in the system only 22M is free. There is no apparent paging or swapping. This left me feeling very uncomfortable, as I count on program timing to evaluate my altorithm. 98% of the time, this large experiment is the only program occupying the cpu. At most I do some editing, browse the web for a half hour once in two weeks and run occasional small program for under 20 minutes. While the program continued to run, I added a short (small <10MB) program that normally takes 35 seconds to run to completion. It took 35 seconds as expected. I made the same test on the Drexel machine and it took 50 seconds, which was as it should be.
    Anyhow, the kicker came when I decided to stop the program to run a few more tests to see what might be the matter. Test 1: I stopped the program and watched the cpu utilization go down to zero. I reset the inputs to exactly the same as the run started three weeks ago. The executable was not touched. This time it ran 1.47 times as fast (really weird). This was somewhat satisfying since 1.47*0.97 is just about the expected speed ratio. The output was identical to the first time I had run it, confirming that nothing internal to the program had been changed. In neither case was there another significant program running. Then I made Test 2. I restarted the program from a point just before I had cut it off in Test 1. So, I was able to compare a small segment (3,000 seconds) of another repeated segment. Again, the new run was faster, this time by a ratio of 1.22/1.
    Have you any idea what might be happening? I do need to understand so I can create a more reliable means of evaluating my runtimes.

    Maybe DBMS_UTILITY.GET_CPU_TIME?

  • My program works only in debugging mode

    Dear All,
    I am just starting to use LabVIEW and developing a instumental driver. 
    The program is rather sequentially designed because I am only used to work with text-based program. 
    The current program is working in debugging mode without any error message.
    To give an idea of how it is composed:
    1. Set up the serial port setting (machine address, baud rate, parity, etc)
    2. Send to the instument the name of a short program to be run. 
    3. Send mutiple string commands to the instruments.  Those string commands construct a short program to control the instrument.
    4. Send another string command to run the short program
    The issue is that it does not work in excution mode.  It looks to me that the communication between the instrument and computer seems to be too fast. 
    Since the program is designed in a sequential manner, it does not have any while-loop or for-loop so I cannot add any timing function. 
    Could anyone give me a hint or a right direction to fix this issue?  It would be really appreciated.  Thank you.
    Solved!
    Go to Solution.

    You could do something like the attached modification.Note how I modified the connector pane for the subVI to use the conventional 4-2-2-4 pattern and notice where I connected the terminals.
    NOTE: I am assuming the VI is supposed to run just once, and that you're not using the Run Continuously button in the toolbar. You're not, right?
    Attachments:
    NE-100_StairFlow_w_RUN00 MOD.vi ‏27 KB
    NE-100_RAT_00_XX MOD.vi ‏18 KB

Maybe you are looking for

  • 10.4.6 Update Didnt mesh well

    I am posting this topic to see if I was the only person who encountered issues when upgrading to 10.4.6 on their MDD system. Once I upgraded (I even erased the drive and used the combo update on the fresh install) my computer wouldnt stay on for more

  • Browser not working correctly

    My browser does not seem to want to go more than the homepage deep on any particular site, the two examples I will use our Snapfish and Realtor.com.  When I try to log into my snapfish account, the screen says loading then just goes grey.  When I try

  • Time out (more than 24 hours) deleting master data.

    We are trying to delete the 0CUST_SALES = ´000000000#´ but we are not able to do it because if we delete and try to save in rsa1>infoobject->choose the characteristic->'master data maintenance', there will be a time out error. We tried than using the

  • Commitment Item in PO without Account Assignment

    Dear All, Where to set to have commitment item in Purchase order, but item not asssigned to any account assignment. Thanks. zhieg

  • Rpd questions.

    Hi Friends, As I am working on OBIEE and getting to know more about it, I am having more and more questions. These might be small but I need to get a clear concept of this. 1. When I pull just dimension columns in 'Answers' and run the query, and whe