Trigger based on Position when using analog feedback

I am developing an application that uses two hydraulic cylinders to move a model in a pitching and plunging motion.
My hardware consists of a P4 computer running windows XP SP2. The motion controller is a PCI-7350, 2 axis board.
The two hydraulic cylinders are equipped with analog position sensors which provide the primary feedback signal for the motion control.
The drive signal from the motion controller is used to open or close a hydraulic valve, closing the loop. The motion portion works great.
I am using buffered contouring to generate a precise motion on the two axis using a vector space. The update rate is 10mSec and the motion appears to be correct. Is the contour update rate a precise 10mSec if the PID is running at 62.5 uSec?
My problem is I need to generate a trigger when the controller is on specific positions of the contour. I can't use breakpoints as I am using analog feedback instead of an encoder. I wrote an onboard program that monitors the contour buffer and toggles the breakpoint line when the controller is on or beyond the specific point. It runs ok and is close but, I am getting an occasional timing discrepency of roughly 16 mSecs. ie the trigger will occasionally be  late by more than 1 contour period.
I tried increasing the size of the buffer to hold all the points as I thought the delays might be occuring when the buffer was being updated. No change in performance. I tried assigning more time to the trigger program as it is the only on board program, but again it seemed to make no difference. I reduced host communications to a minimum, no change.
I have attached my entire application and a test sample waveform  in a zip file. You can run the application without any hydraulic cylinders if you set max following error to 32768. You should have a trigger pulse on the breakpoint line every 500 mSec.
Any pointers would be greatly appreciated.
Attachments:
M22PitchPlunge.zip ‏524 KB

Brian,
Yes, you can reach exactly 10 mS update interval with a PID rate
of 62,5 µSec. You can calculate the actual interval with the forumla
provided here.
Of course the accuracy is limited by the accuracy of the onboard
oscillators of the board but this shouldn't be really relevant.
Generating triggers based on 2D position data is not a trivial
task. I have tried to examine your program but it's a bit hard to read.
I had a look at your onboard program. I don't understand exactly how
you determine if the axes have reached a trigger position or not. It
looks like you are only reading values from buffers. For an exact match
with the physical positions you should read the real position values
from the axes and compare them with your trigger position buffer. In
your comparison algorithm you will need to add some tolerance to allow
some deviation from the ideal trigger position (see image).
There are several possible solutions for your application. You could
either try to implement the more advanced comparison in your onboard
program but I'm not sure if this will result in the performance you
need. The 7350 provides only a limited amount of CPU power for onboard
programs. At last it all comes down to the question how good your
deterministic real-time behavior needs to be. If some ms delay and
jitter are ok for you then you probably could stick with this approach.
If you need a better real-time behavior you should consider using
either an additional real-time board like the PCI-7041/6040E that could run the 2D trigger algorithm or a PCI-7830R board that could run the algorithm on an FPGA.
There are even more options including the NI SoftMotion Development Module to design your own motion controller using LabVIEW RT but again, this depends on your application needs.
Best regards,
Jochen Klier
National Instruments Germany
Message Edited by Jochen on 09-09-2005 10:47 AM
Attachments:
Image1.jpg ‏19 KB

Similar Messages

  • Is there and easy way for Position control using analog input?

    Hi Everyone,
    I would like to set one of the axis with stepper motor using analog feedback to keep the set position which is coming from the analog input.
    In other words I would like the stepper to move when the analog input changes. I need it as a "background service" so the rest of the motion could be easily controlled from the NI-Motion Assistant.
    Is there any easy way to do this? Even complicated is ok but the control should be done by the NI Motion card not the PC processor.
    Thanks,
    Andras

    Hello Andras,
    please use the link below to get the motion example.
    http://zone.ni.com/devzone/cda/epd/p/id/353
    Kind regards,
    Elmar

  • Torque control is not working for my system using analog feedback

    In the test bed, we are testing a brushless DC motor and a load motor generates torque to the test motor. The test motor is running with torque control scheme. They were connected together and I measured the torque signal to feedback the signal and control it. However, I just realized it only control when the torque was static. If I commanded a certain torque value (in this case, counts command), it kept generating that value. However, it did not generate the same torque in different position. I heard NI motion controller could develop torque values by mapping the torque signal with encoder signal. If it's true, the torque generation based on analog feedback, also, needs constraint by rotor position, right? W
    hen I turned on the load machine with constant speed (50 RPM), the torque from the test motor did not provide the constant torque that I commanded. It generated the fluctuated torque values. This means the max torque was generated at one point and decreasing by rotating the shaft and increasing the torque. Keep going in this way. Could you please tell me if this is the correct response when we are using analog torque feedback?
    Thank you.

    Try the following:
    1.-Set your test motor to encoder feedback instead of analog feedback.
    2.-Load a velocity move on the axis for the test motor.
    3.-Set the following error limit on you axis to 0 (disable following error).
    4.-Use the load torque limit function to limit the amount of torque the 73xx PID loop will generate,this value is in volts, so you will need to do a correlation between the voltage output from the controller and the torque reported by your torque cell.
    5.- Start the load motor.
    6.-Engage the cluch.
    7.-Start the velocity move on the test motor, you will see the torque ramp up to the torque limit.
    8.-Call the load torque limit function on the fly to vary the torque setpoint to where you want it.

  • Problem using analog feedback on pix7340

    Hi,
    I am trying to use analog force feedback on one of my axis on pxi 7340. The problem is that MAX always uses encoder as feedback even if i configure it to be analog. In MAX i disabled encoder and enabled the appropriate ADC for the axis and set the position to few hundred counts so the controler stops the axis when force is above a small value (around 1V). If i start motion it moves the same as if the feedback was encoder (for few hundred counts). I dont know what is happening. I red the motion manual and if i understood it correctly the axis should move at the configured speed until the force is larger as value i set in position field.
    Thanks
    Solved!
    Go to Solution.

    Hi toni939,
    please have a look at this document to get a full understanding how analog feedback works with NI motion control boards. I have also gathered all discussions with my involvement about analog feedback under the AnalogFeedback tag.
    Kind regards,
    Jochen Klier
    National Instruments
    Message Edited by Jochen on 02-03-2010 04:20 PM

  • PXI-5660 / 5620. What is lowest reasonable voltage when using Analog Edge Trig?

    Presently, I am using Analog Edge Ref Triggering on the PXI-5660.  The lowest voltage that I can set the trigger level to is 0.200 volts without noise causing the trigger to occur.  Is this level reasonable?  Is there a way to reduce the noise so that the trigger level can be set lower?
    I graphed the waveform coming out of the niScope MultiRead Cluster.vi in the ni5660 Read Average Power Spectrum.vi.  The noise on the graph was as high as 0.190 volts.  I thought that I saw the noise down to 0.010 volts at one time.
    Thanks.

    Thank you for your response.
    The reference level I am using is 0 dBm.
    I ran the ‘niScope SMT Power in Band.vi’ example with dithering enabled and disabled.  I could see the noise when dithering was enabled and the reduced noise or no noise when dithering was disabled.  See attached .jpg’s.  I added ‘Waveform Graph 2’ to display the output of ‘niScope Multi Read Cluster.vi’.
    In my application, I disabled dithering and put the trigger level lower.  It now works.
    Disabling dithering needs to be set after ‘ni5660 Configure for spectrum.vi’.  Inside the ‘ni5660 Configure for Spectrum.vi’, a vi called ‘SMT Configure RFSA for Spectrum.vi’ enables dithering.  ‘SMT Config niScope for Spectrum.vi’ is another vi that enables dithering.
    Thank you for your help.
    Attachments:
    SMT Power in Band with 50 ohm termination on input of 5620 Dither Disable.jpg ‏100 KB
    SMT Power in Band with 50 ohm termination on input of 5620 Dither Enable.jpg ‏106 KB

  • Keep layout position when using Find/Change?

    When using Find/Change in InDesign CS4, each occurrence of the "Found" material is centered in the window, so the page moves around with each find. Is there a way to keep the page in a fixed position when searching through a document?

    Actually, I can think of a shortcut for the hard part: The user uses the
    regular find/change UI to make all their settings. Then, they run the
    script, which will simply use the settings in the UI. Nice, huh! So you
    could get a listBox of all the finds -- select the entry and you get
    taken to the desired location. Click the "change" button and the change
    is made. Here's a proof of concept:
    #targetengine engine20
    var myFinds = app.findText();
    var w = new Window("palette");
    var myList = w.add("listbox", undefined, myFinds);
    var changeButton = w.add("button", undefined, "Change");
    myList.onChange = gotoFound;
    changeButton.onClick = makeTheChange;
    w.show();
    function gotoFound(){
    app.select(myFinds[myList.selection.index].parentTextFrames[0].parent.parent);
         app.select(myFinds[myList.selection.index]);
    function makeTheChange(){
         myFinds[myList.selection.index].changeText();
    Obviously very rudimentary: but this does work in CS4. If the list is
    too long, though, the change button will disappear off the bottom of the
    screen. Also, really once the change is made, the item should be removed
    from the list, but there's a bug in CS4 that makes it impossible to do
    that simply, if I recall correctly (or was that only a tree list?)
    Also, I have found that the only sure way of getting the entire spread
    to show is as I've done it above (and it would need much more error
    checking than this -- for instance, overset text).
    Ariel

  • Best practice about dial-peer creating when using analog lines

    Hi,
    I am trying to find out what is the best practice when creating dial-peer for analog lines on CME, should I use trunk group or create separate dial-peer for each FXO ports? If I use trunk group, is there any advantage ( lesser dial-peer)  or disadvantage?
    Thanks!

    The advantage of trunk groups is that a single dial peer can point to for instance PSTN, rather then multiple dialpeers, with varying preference, each pointing to a separate FXO. Funtionally I can't see much difference. So I guess it also comes down to personal preference.
    =============================
    Please remember to rate useful posts, by clicking on the stars below. 
    =============================

  • Keeping track of caret position when using scrollbars

    Hi!
    I have a jtextarea contained in a jscrollpane, To the jtextarea I have added a caretlistener. The textarea displays a lot of log output that will not be editable. When I move the cursor in the textarea I get updates of the caret position. The problem is that when I use the scrollbars the caret position does not move, which might be the right way. But I would like just that, that is to get an update on which line or position that I am currently on.
    The problem is that the log output is very large so I have to keep track on where I am in the log file, and only have a portion of the log information from the file in the textarea.
    Some pointers, suggestions or examples would really be appreciated.
    Best regards
    Lars

    yes....
    you can do using context listeners....
    in the start of context listeners read from the file and add to context ... and when the context becomes inactive write to a file....
    for that you should use tomcat4.01 ... cause only tat has servlet 2.3 implementaion.
    if you are not using tat .. write to the file every 10 minutes .. atleast you will have the latest update of the counts when something crashes......................

  • Ho can I use left / right dock position when using two screens?

    OSX 10.9 makes a big thing about having the Dock on the active screen.  This certainly works when the Dock is at the botom of the screen, although it does seem sluggish at times before it appears.  I have tended to have my Dock on the left of the screen as I was getting annoyed at losing the bottom part of the screen on my MBP 13". 
    Mavericks doesnt seem to like this and regardless on how I configure the second screen I can't get the Dock to jump away from the MBP screen, apart from closing the lid on my laptop.  Still happening when I put the two screens vertically rather than horizontally (so that the left side of the screen is not a transition zone between the two).
    This is quite frustrating.  I have tried using Dock at bottom again and am just going to struggle with that having not used it for many years now.
    I wonder whether they have just assumed that most people have the Dock at the bottom and functionality has been built around that.
    Any ideas out there?  Apple, any comments?

    Hello again Kirby, I was able to find a workaround that prevents colors from looking overly vibrant on the external display. It seems the "Swap Displays" option under Aperture's monitor configuration drop-down is the culprit. When this is disabled, colors on both monitors match in vibrancy (as much as one can expect given how different the two screens are). But as soon as you enable "Swap Displays", colors on the external display become twice as vibrant. So then the question becomes, how does one show the thumbnail viewer on the laptop screen while viewing the fullscreen image on the external display?
    The workaround is along the lines of what you posted. In dual-monitor mode, Aperture places the thumbnail viewer by default onto whichever screen holds the system menubar. So by placing the system menubar on the laptop screen, I'm able to work in fullscreen mode in the configuration I want without having to activate "Swap Displays", thereby avoiding the boosted colors bug.
    I'll be sending the issue to Apple Feedback now that I have a better understanding on what exactly causes the issue and how to replicate it. Thanks again Kirby for your assistance.

  • Is any extra isolation required when using Analog output to dirve higer power circuitry?

    I want to connect the analog output of a DAQcard-1200 to a current amplifier to give 5A and a tranformer to give approx 200V, is any extra isolation required to protect the card?

    Hello;
    As long as the maximum current that the board can source is taken in consideration and the input impedance of the external circuitry is high enough to prevent signal reflections back to the DAQ board, you should be good to go.
    However, since the protection circuitry can be built with such little budget, I wouldn't take my chances. I would go ahead and include the protection circuitry anyway.
    Regards
    Filipe A.
    Applications Engineer
    National Instruments

  • Scroll Motion Elements Shake When Using Anchors

    When the browser window is narrower than the site, elements with scroll motion "shake", often severely, and sometimes change position when using links to jump to different anchors on the page. What causes this and is there a way to fix it?
    Here is the site I'm working with. If you scroll using the scroll bars, there is no issue, it only happens when using the links in the bar at the top. Any ideas? Thanks.
    http://cuberogroup.businesscatalyst.com/

    Hi @Kydos 
    Thank you for your reply.
    I grasp that if you disable the graphic driver in device manager the issue is gone.
    Here is a link to  Resolving Video and Graphics Issues that will assist with this.
    Have you tried running the  HP Support Assistant  to look for any HP updates?
    Here is a link to the  HP Envy 17t-1000 CTO Notebook Software & Drivers  to verify you have all the recommended updates.
    You could also try reseating the card if that does not help.
    Next would be to test the card. Testing for Hardware Failures (Windows 7, Vista)
    Good Luck!
    Sparkles1
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom right to say “Thanks” for helping!

  • Freeze Frame Duration Selection Is Incorrect When Using PAL Projects ?

    I have done a search of the FCE and FCP forums but can find no information. This was originally posted in the FCP forum but is equally applicable to FCE.
    Over here in Europe an apparent bug has been noticed connected with FCP 5.1 and FCE 3.5 (which is based on it) when using PAL projects.
    To begin with, the default Freeze Frame time in the User Preferences is 12 seconds yet when stills appear in the Browser they are the normal 10 seconds.
    If the duration in the Preferences is altered, the actual time of the picture in the Browser or Timeline is always five sixths of the time set.
    This curiously is the same figure you get if you compare NTSC and PAL frame rates. PAL has five sixths the number of fps as NTSC.
    So if in the preferences I set 6 seconds, I get 5 seconds in the Browser. Three seconds gives an actual time of around two and a half seconds and so on.
    I must stress that it is only FCP 5.1 and FCE 3.5 that appear to be affected.
    Earlier versions eg. FCE 1.0.1 and FCE 3.0 behave perfectly.
    We don't know the situation with FCP 6 as we have not yet had the opportunity to test it.
    You can replicate the problem by altering your Easy Setup to DV-PAL and look at the Freeze Frame Duration in the preferences.
    Then import a photo into the Browser.
    Alter the duration in the preferences and import another photo.
    I am sure you will see that there is a large discrepancy between the chosen duration and the actual.
    Is this a known problem and is there a simple way around it ?
    Ian.

    CORRECTION !
    It has been pointed out that the Freeze Frames are NOT affected by this bug - only the IMPORTED STILL PICTURES.
    Incidentally, for any PAL user whose maths is not too good (like mine), here is a table of corrections:-
    Freeze Frame Discrepancy.
    From Final Cut Pro 5.1 and Final Cut Express 3.5 onwards there is a bug that makes the chosen Freeze Frame time WHEN IMPORTING STILL PICTURES differ from the actual time when using PAL settings.
    This table tells you what time (in seconds and frames) to set your preferences in order to achieve an actual time:-
    Desired Time.......... Set Preferences
    01:00.......... 01:05
    02:00.......... 02:10
    03:00.......... 03:10
    04:00.......... 04:15
    05:00.......... 06:00
    06:00.......... 07:00
    07:00.......... 08:10
    08:00.......... 09:10
    09:00.......... 10:15
    10:00.......... 12:00
    Ian.

  • Problem when analog feedback is set as primary feedback

    I have a simple labview program for pressure control. Primary feedback is set to ADC 1 in MAX. ADC 1 is connected to a voltage signal which represents a pressure. When the motor run from program, the motor stopped after certain time because move complete turn to True, but the position reading didn't reach the desired position at this time. If the motor run from MAX, the motor didn't stop untill the position reading reached the desired value.
    The configuration file exported from MAX and lv program are attached. I would appreciate you very much if anybody could find problems in my program or configuration.
    I am using PCI 7342.
    Thanks.
    Attachments:
    ADC_primary_feedback.xml ‏581 KB
    pressure_control_2.vi ‏74 KB

    Hello Ya-hoo.
    I first just want to clarify what I think your issue is. It sounds like you essentially have a servo motor system with analog feedback. This system is moving to the desired position (pressure) when it is run through 1-D interactive in MAX, but it does not correctly move in your LabVIEW program.
    This situation is uncommon but it can happen. Generally speaking, the things to make sure of:
    Be sure the settings are saved in MAX and that the board is initialized with those settings before running the LabVIEW program
    Make sure you are not calling the stop VI too early. In the while loop you are polling the move complete criteria. What happens if you take that out and simply wait until the user pushes the stop button? If this fixes
    the problem, try adjusting some of the Move Complete criteria (Trajectory Settings in MAX) and see if that changes the behavior.
    As far as the tuning is concerned, I will refer you to the following tutorial on Understanding Servo Tune. This should go over some tuning concepts.
    Hope this helps.
    Regards,
    Colin C.
    Applications Engineering
    Colin Christofferson
    Community Web Marketing
    Blog

  • When use *"af:inputComboboxListOfValues"* partial trigger option, values no

    Dear All,
    When use *"af:inputComboboxListOfValues"* partial trigger option, values not refresh correctly.
    My code steps as follows :
    (Step 1). create as "af:inputComboboxListOfValue" attach a VO to it ...
    <af:inputComboboxListOfValues id="lovDescriptionId"
    popupTitle="Search and Select: #{bindings.Description.hints.label}"
    value="#{bindings.Description.inputValue}"
    label="Reason"
    model="#{bindings.Description.listOfValuesModel}"
    required="#{bindings.Description.hints.mandatory}"
    columns="#{bindings.Description.hints.displayWidth}"
    shortDesc="#{bindings.Description.hints.tooltip}"
    binding="#{backing_pages_MainProfileAction.lovDescriptionId}"
    disabled="false"
    partialTriggers="soc3 si1 si2">
         <f:validator binding="#{bindings.Description.validator}"/>
    </af:inputComboboxListOfValues>
    (Step 2). In a extrnal event change (say a button click) the VO data of above filted. So as a final case of this button action it should invoke partialTriggers.
    But this not working...?
    Please be kind enough to give solutions based on this case....
    Thanks,
    Sagara.

    Dear Frank,
    From your suggestion I research continued until today.
    Thanks for your highlighted point. By that I could resolve about 80% of my problem.
    There have to think another small area of regarding my entire problem.
    In af:inputComboboxListOfValues only acsept view Accessor or LOV which based on a main VO.
    So you say pass bind variable parameter value to ViewCriteria of LOV. I could do this & get filtered data to inputComboboxListOfValues.
    But is ther way to pass value to this bind variable by programmatically?
    (Currently I could do, pass value to the LOV ViewCriteria via field of main VO)
    Sagara.

  • It is not working when use trigger to check data from other table.

    Please help me with this, I have put a trigger on a table but it can not work as I expect.
    case study: one class has many students, only one of them goes to match.
    The purpose of this trigger is to check when choose a student goes to match, this student must in his class where he belongs to.
    Version of Oracle is 10.2.0.1.0.
    --table:
    DROP TABLE STU;
    DROP TABLE CLASS;
    create table CLASS(
    CID     VARCHAR2(5)   PRIMARY KEY,
    CNAME   VARCHAR2(20)  NOT NULL,
    SCHOSEN VARCHAR2(5));
    create table STU(
    SID     VARCHAR2(5)   PRIMARY KEY,
    SNAME   VARCHAR2(20)  NOT NULL,
    CID     VARCHAR2(5)   NOT NULL REFERENCES CLASS(CID) ON DELETE CASCADE);
    --data:
    --CLASS
    INSERT INTO CLASS(CID,CNAME) VALUES(1,'SUN');
    INSERT INTO CLASS(CID,CNAME) VALUES(2,'MOON');
    INSERT INTO CLASS(CID,CNAME) VALUES(3,'EARTH');
    --STU
    INSERT INTO STU VALUES(1,'JACK',1);
    INSERT INTO STU VALUES(2,'TOM',1);
    INSERT INTO STU VALUES(3,'LILY',2);
    INSERT INTO STU VALUES(4,'DUSTIN',3);
    --TRIGGER
    CREATE OR REPLACE TRIGGER CHECK_SCHOSEN
    BEFORE INSERT OR UPDATE OF SCHOSEN ON CLASS
    FOR EACH ROW WHEN (NEW.SCHOSEN IS NOT NULL)
    DECLARE
    DUMMY INTEGER;
    INVALID_STU EXCEPTION;
    VALID_STU EXCEPTION;
    MUTATING_TABLE EXCEPTION;
    PRAGMA EXCEPTION_INIT(MUTATING_TABLE, -4091);
    CURSOR DUMMY_CURSOR (ST VARCHAR2, CL VARCHAR2) IS
      SELECT SID FROM STU, CLASS
      WHERE STU.SID=ST AND STU.CID=CLASS.CID AND CLASS.CID=CL
        FOR UPDATE OF CLASS.SCHOSEN;
    BEGIN
      OPEN DUMMY_CURSOR(:NEW.SCHOSEN, :NEW.CID);
      FETCH DUMMY_CURSOR INTO DUMMY;
      IF DUMMY_CURSOR%NOTFOUND THEN
        RAISE INVALID_STU;
      ELSE
        RAISE VALID_STU;
      END IF;
      CLOSE DUMMY_CURSOR;
    EXCEPTION
      WHEN INVALID_STU THEN
        CLOSE DUMMY_CURSOR;
        DBMS_OUTPUT.PUT_LINE('PLEASE RE-ENTER CLASS ID AND STUDENT ID AS CLASS OR STUDENT IS NOT VALID.');
      WHEN VALID_STU THEN
        CLOSE DUMMY_CURSOR;
        DBMS_OUTPUT.PUT_LINE('STUDENT CHOOSE SUCCEFULLY!');
      WHEN MUTATING_TABLE THEN
        NULL;
    END;
    /Just copy and paste above and try to run following:
    UPDATE CLASS
    SET SCHOSEN=3
    WHERE CID=1;
    Clearly,you can not choose student which is 3 as match member of class 1. Please help me. Thanks.
    Edited by: 991096 on 01-Mar-2013 02:36
    Edited by: 991096 on 01-Mar-2013 03:03
    Edited by: 991096 on 01-Mar-2013 03:11

    Hi,
    Welcome to the forum!
    Like the others, I can't see a business purpose for this trigger. I assume it's just an experiment to learn how triggers work.
    991096 wrote:
    Please help me with this, I have put a trigger on a table but it can not be triggered.Sorry, I don't understand what you want help with.
    Are you saying the trigger doesn't fire? It does fire; it just raises the mutating table error, so you don't see anything.
    case study: one class has many students, only one of them goes to match.What do you mean when you say "goes to match"?
    --table:
    DROP TABLE STU;
    DROP TABLE CLASS;
    create table CLASS(
    CID VARCHAR2(5) PRIMARY KEY,
    CNAME VARCHAR2(20) NOT NULL,
    SCHOSEN VARCHAR2(5));
    create table STU(
    SID VARCHAR2(5) PRIMARY KEY,
    SNAME VARCHAR2(20) NOT NULL,
    CID VARCHAR2(5) NOT NULL REFERENCES CLASS(CID) ON DELETE CASCADE);
    --data:
    --CLASS
    INSERT INTO CLASS(CID,CNAME) VALUES(1,'SUN');
    INSERT INTO CLASS(CID,CNAME) VALUES(2,'MOON');
    INSERT INTO CLASS(CID,CNAME) VALUES(3,'EARTH');
    --STU
    INSERT INTO STU VALUES(1,'JACK',1);
    INSERT INTO STU VALUES(2,'TOM',1);
    INSERT INTO STU VALUES(3,'LILY',2);
    INSERT INTO STU VALUES(4,'DUSTIN',3);
    --TRIGGER
    CREATE OR REPLACE TRIGGER CHECK_SCHOSEN
    BEFORE INSERT OR UPDATE OF SCHOSEN ON CLASS
    FOR EACH ROW WHEN (NEW.SCHOSEN IS NOT NULL)
    DECLARE
    DUMMY INTEGER;
    INVALID_STU EXCEPTION;
    VALID_STU EXCEPTION;
    MUTATING_TABLE EXCEPTION;
    PRAGMA EXCEPTION_INIT(MUTATING_TABLE, -4091);
    CURSOR DUMMY_CURSOR (ST VARCHAR2, CL VARCHAR2) IS
    SELECT SID FROM STU, CLASS
    WHERE STU.SID=ST AND STU.CID=CLASS.CID AND CLASS.CID=CL
    FOR UPDATE OF CLASS.SCHOSEN;
    BEGIN
    OPEN DUMMY_CURSOR(:NEW.SCHOSEN, :NEW.CID);
    FETCH DUMMY_CURSOR INTO DUMMY;
    IF DUMMY_CURSOR%NOTFOUND THEN
    RAISE INVALID_STU;
    ELSE
    RAISE VALID_STU;
    END IF;
    CLOSE DUMMY_CURSOR;
    EXCEPTION
    WHEN INVALID_STU THEN
    CLOSE DUMMY_CURSOR;
    DBMS_OUTPUT.PUT_LINE('PLEASE RE-ENTER CLASS ID AND STUDENT ID AS CLASS OR STUDENT IS NOT VALID.');
    WHEN VALID_STU THEN
    CLOSE DUMMY_CURSOR;
    DBMS_OUTPUT.PUT_LINE('STUDENT CHOOSE SUCCEFULLY!');
    WHEN MUTATING_TABLE THEN
    NULL;
    END;
    /Thanks for posting the CREATE TABLE, INSERT and CREATE TRIGGER statements; that really helps!
    See the forum FAQ {message:id=9360002} for other helpful tips, such as how to use \ tags to post formatted code.
    Just copy and paste above and try to run following:
    UPDATE CLASS
    SET SCHOSEN=3
    WHERE CID=1;
    Clearly,you can not choose student which is 3 as match member of class 1. The trigger did not be triggered. Please help me. Thanks.You can't do DML, or even query, the class table from a FOR EACH ROW trigger on the same class table.
    Add 3 more calls to put_line to see this:CREATE OR REPLACE TRIGGER CHECK_SCHOSEN
    BEFORE INSERT OR UPDATE OF SCHOSEN ON CLASS
    FOR EACH ROW WHEN (NEW.SCHOSEN IS NOT NULL)
    DECLARE
    DUMMY          INTEGER;
    INVALID_STU      EXCEPTION;
    VALID_STU          EXCEPTION;
    MUTATING_TABLE      EXCEPTION;
    PRAGMA           EXCEPTION_INIT (MUTATING_TABLE, -4091);
    CURSOR DUMMY_CURSOR (ST VARCHAR2, CL VARCHAR2) IS
    SELECT SID
         FROM      STU
         ,     CLASS
         WHERE     STU.SID          = ST
         AND     STU.CID          = CLASS.CID
         AND     CLASS.CID     = CL
         FOR UPDATE OF           CLASS.SCHOSEN;
    BEGIN
    dbms_output.put_line (:NEW.schosen || ' = schosen entering check_schosen');     -- ***** NEW *****
    OPEN DUMMY_CURSOR (:NEW.SCHOSEN, :NEW.CID);
    dbms_output.put_line ('Cursor is open now.');     -- ***** NEW *****
    FETCH DUMMY_CURSOR INTO DUMMY;
    IF DUMMY_CURSOR%NOTFOUND THEN
    RAISE INVALID_STU;
    ELSE
    RAISE VALID_STU;
    END IF;
    CLOSE DUMMY_CURSOR;
    EXCEPTION
    WHEN INVALID_STU THEN
    CLOSE DUMMY_CURSOR;
         DBMS_OUTPUT.PUT_LINE ('PLEASE RE-ENTER CLASS ID AND STUDENT ID AS CLASS OR STUDENT IS NOT VALID.');
    WHEN VALID_STU THEN
         CLOSE DUMMY_CURSOR;
         DBMS_OUTPUT.PUT_LINE ('STUDENT CHOOSE SUCCEFULLY!');
    WHEN MUTATING_TABLE THEN
    DBMS_OUTPUT.PUT_LINE ('MUTATING TABLE');     -- ***** NEW *****
         NULL;
    END;
    Output, when trying to UPDATE class:3 = schosen entering check_schosen
    MUTATING TABLE
    1 row updated.
    Obviously, the trigger fired, since you see the message "3 = schosen entering check_schosen"
    Obviously, the OPEN statement raised an error, since you don't see the message 'Cursor is open now.'
    Obviously, the mutating table error was raised, since you see the message 'MUTATING TABLE'.
    So the trigger fired, and went to the EXCEPTION handler almost immediately.  The EXCEPTION handler printed a message, as instructed, and the trigger ended.  Then the actual UPDATE took place.
    I hope this answers your question.
    If not, what is your question?  It may be very clear to you, but a complete mystery to others.  Ask clear questions, such as "Why did ... happen?  I thought ... would happen, be ... as the PL/SQL manual says at ...".                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • ITunes 7.1.1 and Vista

    So is iTunes finally compatible with Vista? Or are there still issues?

  • Problem In Converting BDC recording to program

    Hi to all, I have recorded ZMM01 using t-code MM01 to create material with accounting codes. Here i am able to create material with accounting codes. But when I am converting that into program there i am getting problem(not creating any material and

  • Network Load Balancing - Multicast IPv6

    I have a two servers with network load balancing. They are configured to use IGMP Multicast which works well with IPv4.  The switch correctly detects the group and sends the traffic to only the ports connected to the servers. However i can't get IPv6

  • New Time Machine/Mavarick Problem

    Trying to do initial back-up of new iMac to 1st Generation Time Capsule.  The TC has worked perfectly in backing up my old iMac running Lion.  Used  Set-up Assistrant to migrte files from old to new iMac,and everything came over nicely.  All apps had

  • Email sent box

    Why does my email sent box show I have 104 sent emails whilst in fact it is empty?