Using a hardware trigger to reset a counter

Hi all...I am trying to using a quadrature encoder with A,B,Z outputs on an e-series card (pci-6052e). the problem is that the card does not support the z output since it only has 2 counters. So i am trying to find a way to get around this problem. I start off using ctr 1 (to the source pin of which i connect the A signal)..to count the events which will tell me how many angles the shaft has rotated through. The only other thing i need is to use the single pulse generated on the z line to reset the count each time it turns high. From reading posts it seems like i have to stop and restart the counter task to accomplish this. So the thing i dont know how to do is to convert that pulse on the z-line to a boolean value so i can run a case loop to stop and restart the task. I can use a daq-mx start trigger to look at the pulse but how do i convert that to a boolean value to run the case loop.
Thanks in advance, Shyam.

Hi Shyam,
Depending on how fast the encoder will be rotating, you can do a few things. The simplist is to just read the Z index on a digital line as you have begun doing. Using a DAQmx Read, you can detect the state of the line and if the rotation is slow enough, you can use the boolean value. Again, this is not ideal. The newer M-Series boards have a counter input for the Z index in addition to being able to do change detection on digital lines which will make this task much easier. See if this works for your needs.
Regards,
Kent
Applications Engineer 
Digital Multimeter Home

Similar Messages

  • Data-acquisition with NI 6036E DAQ card & GPIB using an external trigger

    Hi all,
    I hope somebody could give me some help with the following and answer some questions:
    Simple system description:
    Labview 6.1
    PCI-GPIB card
    6036E DAQ card
    In my system, I am using an external analog trigger signal (A) for continuous data-acquisition. Characteristics of the analog trigger signal (A) are: ~40 Hz, signal height +1.48V, triggered by rising edge (the analog trigger signal (A) could be changed to a TTL signal). Each data-acquisition is done within ~1.0 ms after the rising edge of the trigger pulse. The timing of the data-acquisition and analyzing procedure is controlled by execution in a sequence structure placed in a loop.
    Now, I connected a power meter to the system, to measure the laser power during the data-acquisition. The power meter has two options to provide the laser power data:
    a) via analog signal output (voltage corresponds to laser power in watts)
    b) via GPIB (direct output reading of laser power in watts).
    Problem:
    During a certain point in my data-acquisition sequence structure (defined by a frame), I want to use the next occuring analog trigger signal (A) to acquire 1 value from the power meter.
    How do I do this in Labview programming for the following two situations?
    a) If I connect the analog output from the power meter to an analog input channel of the 6036E DAQ card. The analog trigger (A) would be connected to a second analog input channel (In case the analog trigger signal (A) is changed to a TTL signal it would be connected to the PFI0/Trig input pin on the DAQ card).
    b) If I use the GPIB connection of the power meter. The analog trigger (A) would be connected to a second analog input channel (In case the analog trigger signal (A) is changed to a TTL signal it would be connected to the PFI0/Trig input pin on the DAQ card).
    An other possibility would be to trigger the power meter directly, so it outputs constantly power meter values at ~40 Hz. How could I than acquire 1 power meter value (at a certain time im my sequence structure) via analog input at DAQ card or GPIB?
    Additional questions:
    How do I configure the PFI0/Trig pin on the 6036E DAQ board individually as an INPUT?
    How do I use an analog trigger signal (A) as counting signal for a loop, or as an activation signal for a sequence structure which includes GPIB commands?
    It would be very nice if somebody could give me some help.
    Kind regards,
    beam

    Hi beam,
    I just want to verify that I understand your situation correctly:
    An external trigger signal (A) is wired to one of your input channels (e.g. CH0) to trigger data acquisition of a second channel (e.g. CH1). Your power meter is connected to an analog input channel, which you would like to trigger with a certain rising edge at some of your sequence structure.
    Problem:
    During a certain point in my data-acquisition sequence structure (defined by a frame), I want to use the next occuring analog trigger signal (A) to acquire 1 value from the power meter.
    How do I do this in Labview programming for the following two situations?
    a) If I connect the analog output from the power meter to an analog input channel of the 6036E DAQ card. The analog trigger (A) would be connected to a second analog input channel (In case the analog trigger signal (A) is changed to a TTL signal it would be connected to the PFI0/Trig input pin on the DAQ card).
    If a task has been configured to acquire signal from one analog channel, it's not possible to run a second analog input task or to add a second channel on the fly. You had mentioned that it's possible to read from the instrument through GPIB. Is it possible to perform a software trigger such that at a certain frame of your structure, when the trigger signal A reaches voltage "x", a GPIB command is written to your power meter to query a measurement reading?
    Additional questions:
    How do I configure the PFI0/Trig pin on the 6036E DAQ board individually as an INPUT?
    You do not need to explicitly configure the PFI0 line as an input. If you want to use it as an input such that it acts as an analog trigger, simply wire the trigger signal to this pin. When configuring the trigger in your software, specify PFI0 as the trigger source.
    How do I use an analog trigger signal (A) as counting signal for a loop, or as an activation signal for a sequence structure which includes GPIB commands?
    You can try using the Limit VI to find out when the trigger signal reaches a certain level, and count how many times this level is reached. Similarly, you can use this as the condition to execute GPIB commands.
    Hope this helps,
    Lesley

  • IMAQdx with JAI and a hardware trigger

    Hello,
    We are working with two 'JAI AD-080' cameras and IMAQdx, and have two problems regarding the triggering and frame grabbing:
    1)  We are unable to change the trigger source through IMAQdx property node or the Vision Acquisition Express; Vision Acquisition block.
    2)  When we manually edit the trigger source property using the NI Measurement and Automation Explorer (MAX) to its correct value, we can't get all four of the CCD's to run at a time without resulting in bad packets, e.g. horizontal black lines across the images.
    Our goal is to obtain the images from the 4 CCD's at a rate of 5 Hz using our hardware trigger.  We can already connect and obtain all four images at full speed, but the 5 Hz trigger is not being used by the cameras in that case.
    Details of the setup:
    NI 2011, Windows 7 
    Two (2) JAI AD-080 cameras (with 2 CCD's each), GigE cameras connected over Ethernet
    Hardware triggering at 5 Hz, on pin:  'Line 7 - TTL In 1'
    Details of the problem:
    (1)  Setting the trigger source not possible in Vision Express or IMAQdx property node
    In order to use our hardware trigger, we have to set the camera property 'CameraAttributes::AcquisitionControl::TriggerSour​ce' to a specific pin (Line 7 - TTL In 1).  This property is available in MAX, but is not usable in the Vision Express Block.  The property is present, but the values are invalid.  Here is what I think is happening:  the list of properties are read from the camera, but LabVIEW does not know what the valid values are for that property and it populates the value drop-down menu with whatever was loaded last.  This can be seen in figures 1 and 2 where the values in the drop down menu change.
    Similarly, this property of 'Trigger Source' cannot be changed programmatically using the IMAQdx property node shown here: http://digital.ni.com/public.nsf/allkb/E50864BB41B​54D1E8625730100535E88
    I have tried all numeric values from 0 to 255, and most give me a value out of range error, but the ones that do work result in no change to the camera.
    (2)  Lost packets in image during triggering
    If I set the 'Trigger Source' property in MAX to the correct pin, save the configuration, and then use the Vision Acquisition Express block to connect to the camera, the triggering works properly (the hardware trigger is used and the images are received by LabVIEW at 5 Hz).  However, this only works for one CCD:  If i use the same code for all four CCD's at the same time, I get black bars on the images, and at least one of the CCD's result in an error in 'IMAQdx Get Image.vi'  (code -1074360308, -1074360316)
    I tested this by using the configuration attributes created by the Vision Express Block, (The string used in the 'IMAQdx Read Attributes From String.vi'),  in the code we have been developing as well as a very simplified version which I have attached.  Those configuration attributes are saved in the text files:  JAI_Config_TrigON.txt and JAI_Config_TrigOFF.txt for using triggering or not respectively.  
    So my final questions are:
    Is there a problem with the IMAQdx because it doesn't recognize the trigger source value?
    Do you have any suggestions for why there are bad packets and trouble connecting to the cameras when I load them with the trigger on attributes?
    Thank you for your time - 
    Attachments:
    Fig1_VisionAcq.png ‏387 KB
    Fig2_VisionAcq.png ‏442 KB
    Fig3_BadPackets.png ‏501 KB

    Hello,
    Thank you for your response; especially the speed in which you responded and the level of detail.  
    I have not solved the problem fully in LabVIEW yet, but I was able remove the black lines and apparitions from the images using different camera parameters.  
    Since this was a significant victory I wanted to update:
    1)  Version of IMAQdx?
    I have IMAQdx 4.0, but the problem persists.
    2)  Setting configuration files
    Your suggestion to pay attention to the order in which the properties are set as well as using the MAX settings is very helpful.  I have not explored this feature fully, but I was able to successfully use MAX to set the default settings and then open the cameras programmatically without loading a new configuration file.  
    3)  Bandwidth limitations
    I modified the CCD's to only use 250 Mbits/second, but the lost packets (or missing lines/ apparitions) were still present.  
    4)  JAI AD-080GE Specifics
    I am using the JAI AD-080GE; and there are two settings for this camera that I want to mention:  
    JAI Acquisition Control>> Exposure Mode (JAI)>>Edge pre-select
    JAI Acquisition Control>> Exposure Mode (JAI)>>Delayed readout EPS trigger
    The "Edge pre-select" mode uses an external trigger to initiate the capture, and then the video signal is read out when the image is done being exposed.
    The "Delayed readout EPS trigger" can delay the transmission of a captured image in relation to the frame start.  It is recommended by JAI to prevent network congestion if there are several cameras triggered simultaneously on the same GigE interface.  The frame starts when the 'trigger 0' is pulsed, then stored on the camera, then is transmitted on 'trigger 1'.  
    The default selection is the "Delayed readout EPS trigger", however, I do not know how to set the 'trigger 1' properly yet and I only have one connection available on my embedded board that is handling the triggering right now (I don't know if 'trigger 1' needs to be on a separate line or not).  Incidentally, the system does not work on this setting and gives me the black lines (aka lost packets/ apparitions).
    I was able remove the black lines and apparitions using the "Edge pre-select" option on all 4 images with a 5 Hz simultaneous trigger.  I confirmed this using the "JAI Control Tool" that ships with the cameras.  I am unable to make this happen in MAX though, as the trigger mode is automatically switched to 'off' if I use the mode:  JAI Acquisition Control>> Exposure Mode (JAI)>>Edge pre-select
    i.e. when manually switching the trigger mode to 'on' in MAX, "JAI Acquisition Control>> Exposure Mode (JAI)>>Delayed readout EPS trigger" option is forced by MAX.  The vise-versa is also forced so that if EPS mode is chosen, "Trigger Mode Off" is forced.
    Additionally, there is a setting called:
    Image Format Control>>Sync Mode>>Sync     &     Image Format Control>>Sync Mode>>Async
    When the "Sync" option is chosen the NIR CCD uses the trigger of the VIS CCD.  In addition to using the "Edge pre-select" option, the "Sync" option improves the triggering results significantly.  
    5)  Future troubleshooting
    Since I cannot set the camera parameters manually in MAX (due to MAX forcing different combinations of parameters in 4), I am going to explore manually editing the configuration file and loading those parameters at startup.  This can be tricky since a bad combination will stall the camera, but I can verify the settings in JAI Control Tool first.  There is also an SDK that is shipped with the cameras, so I may be able to use those commands.  I haven't learned C/C++ yet, but I have teammates who have.

  • How can I use the hardware compare feature of the 6551 card to trigger scripts

    I can dynamically and seamlessly generate different waveforms by triggering different scriptTriggers that drive one or more of the 4 PFI lines. However, I need to evaluate a channel at a specific location or locations set by a script marker in real-time and generate a different waveform stored in on-board memory based on the result of the evaluation. I have attempted to use the hardware compare feature without any success. I am trying to dynamically respond to an I2C device based on the ACKs or NACK response of the device under test. Can the 6551 card accomplish this? Has anyone successfully tested an I2C or SMBus communication stream with 6551 card?

    Hello,
    I can understand why hardware compare did not work out for you application.  Hardware compare uses a signal that was generated to make a digital pattern and then waits a few clock cycles before acquiring the signal that needs to be compared to the digital pattern. 
    I would look into using a script trigger to evaluate the channel value, where the script structure controls when it is evaluated.  Please note that script triggers will need to be cleared after they are detected for reasserting.  Some script syntax actually clear the script trigger and then use a wait until script trigger structure.  Please refer to the HS DIO Help for documentation on Common Scripting Use Cases. 
    Please provide us with further details about your application.  The more information, the better!  I was not too clear on what you where wanting to evaluate and where is it coming from. 
    I would also like to mention that National Instruments has a NI USB 8451 which is capable of I2C communication.
    NI USB 8451
    Samantha
    National Instruments
    Applications Engineer

  • How to reset a counter on external signal in LabView?

    Hallo there!
    I am using LabView v 8.5 and the NI USB-6211 to acquire signals, among them are the following:
    1) angular pulses from a rotary encoder
    2) a reference pulse for the rotary encoder witch will give a pulse on a specific position of the movement for every rotation
    3) value from a pressure sensor
    What I am trying to do is to create a pressure/volume diagram based on the pressure and volume inside a cylinder of an IC engine. To do this, I will need the angle of the engines crankshaft to calculate the pistons position in the cylinder. This way I can calculate the volume and put it in a xy graph to represent the volume (x-axis) and the pressure(y-axis).
    I am using clk0 to count the pulses from the angular encoder, and this works great. However I now need the reference pulse to somehow reset the count at the precise time it goes high in order to precisely know the angular position.
    How can I do this? And how precise will this be? And will I need any kind of synchronization with my pressure measurements? If so, how?
    The relevant part of the program I am working on resembles the Count Digital Events with reset.vi 33 KB as found in this thread. However, I don't know how to get the reference pulse to reset as the stop button is. How can I do this?
    In addition: the fast pulses of the angular encoder = 0-> ~10kHz. I seem to lose information if I use the basic level trigger detection.vi when I put this signal on an analog port.
    -J

    Hi Nick,
    If you have an X Series or 2nd Generation cDAQ chassis (basically any cDAQ chassis except for the 9172 or 916x sleeves) then you can implement:
    1,2,3,4,5,6,7,8,9,10,(reset),1,2,3,4,5,6,7,8,9,10,(reset),1,2...
    You would have to configure an Edge Count Task, set the initial value to 232 - 6 (such that the 6th count causes the counter to rollover, which generates a pulse on the counter output), and enable the count reset using your external signal:
    The count reset isn't currently available for other DAQ devices, but I believe it should be available on M Series (62xx) and TIO (660x, 6624) with a future driver release (some time in 2012).
    If you don't have an X Series (or gen II cDAQ), don't despair.  On other hardware, you can get close to the previous behavior with a counter output task, with the exception that the "reset" signal would only be detected after the 2nd tick after your pulse is output.  Also, the reset signal would have to occur at the beginning to arm the counter the first time.
    Or, you can get the 3rd behavior that you asked for by doing a continuous counter output task with the external signal as the source of the timebase ticks.  For example:
    1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9
    In toggle mode (default):
    6 ticks of initial delay, 2 ticks high, 7 ticks low, 2 ticks high, 7 ticks low, ... etc.
    In pulse mode:
    6 ticks of initial delay, 9 ticks high, 9 ticks low, 9 ticks high, 9 ticks low, ... etc.
    See here for an overview of the difference of the two modes.  Basically, pulse mode will emit a short pulse when TC is reached, and toggle mode will toggle the state of the counter.  You can't have less than 2 ticks as a high time, low time, or initial delay.
    Best Regards,
    John Passiak

  • Can we demodulate the signal recieved at DAQ card without using any hardware interface(by only using labview)?

    Hi all,
    Can we demodulate the signal recieved at DAQ card without using any hardware interface(by only using labview)? if yes then how? please give brief idea.
    Regards,
    Amit

    There is probably a way to do it, but it it may be easier to use an X-series board for the job.   They support a new counter capability for count reset on a digital edge without needing to be configured in encoder position mode.  I am not sure exactly how that feature's been implemented however, so maybe it won't make things easier after all.
    The plan based on the hoped-for behavior: 
    1. Configure an X-series counter for pulse generation based on "ticks" of your clock channel.
    2. Set both initial delay and low time to the critical # of ticks.
    3. Configure for count reset on a digital edge (if possible in pulse generation mode)
    4. Configure the count reset value to be the critical # (or possibly 1 less, if possible in pulse generation mode)
    5. If you want the output to remain high indefinitely, configure the counter task to use its own output as a
    pause trigger, and pause while high.
    The way pulse generation works is to preload a # of "low time" ticks into the count register.  Then every source edge will decrement the count.  When the count reaches terminal count (0), the counter's output is toggled (or can be configured to pulse).  The register is then loaded with the # of "high time" ticks and the process continues.
    You would be perpetually interrupting the count-down process as long as you got your triggers in time.  The count would keep getting reset to the # of low counts, keep decrementing toward 0 without reaching it, and so on.  If ever you did reach 0, the output state would toggle high, then the high state would prevent subsequent clock signals from decrementing the count.
    You can conceivably do a similar thing with a 6601, but I'm pretty sure you'd need 2 counters working together to get it working.
    -Kevin P

  • NI-6602 - Encoder capture - resetting the counter to 0 through software - DAQmx

    Hello. A simple one. I'm using DAQmx to set up a task to set channel 0 on an NI-6602 as an angular encoder capture port. This is working fine and I can grab the position in degrees. The simple question is - How do I reset the counter to 0 through software. I can set up ZIndex to do it but how do I either reset the counter or set it with an arbritrary number? I can see a method to set it on startup but not during capture.
    Thanks.
    Will

    If working in LabVIEW, there are DAQmx property nodes that will allow you to set the "initial count" value, but ONLY while the task is stopped.
    If you can't count on a hardware z-index reset, another software technique I've used to avoid stopping the DAQmx task.  I make a wrapper function for all my encoder task access (see the Action Engine nugget for ideas...).   Inside this "Action Engine" wrapper, I use an uninitialized shift register to store my encoder's "virtual 0".  I add a simple function to the action engine for setting the "virtual 0" to be the current encoder position value.  Every time I read from the encoder, I first subtract off the virtual zero before returning the data.  As far ast the rest of the app is concerned, the encoder data it gets is just as if I were able to make a software call to DAQmx to set the raw count to zero.
    -Kevin P.

  • With DAQmx, how to use AO start trigger for AO/AI synchronization with finite AI sampling

    I am a new user to DAQmx and I am trying to synchronize AI (finite samples) with AO in LabVIEW 7.1 using a PCI 6229 card. I want to generate a finite waveform (AO) and, subsequently, collect a finite number of voltage samples (AI). I would like to repeat the AO-AI cycles in a while loop.
    Alternatively, I could use an infinite AO generation and collect finite number of voltage samples on AI but always exactly at the same spot of the AO buffer.
    Using traditional DAQ and a 6024E card, I used a counter triggered by AO start trigger signal (example attached). I have problems with translating this example into DAQmx.
    Please help!
    Ruber
    Attachments:
    AIAODelay_traditional_Eseries.vi ‏155 KB

    Lesley,
    Thank you very much for your suggestion. Late last night I actually tried a to use AI start trigger instead of AO start trigger and it worked (since I tried the AI & AO to start simultaneously, it does not matter what triggers what), even in the loop. The devil is in details, as I had to carefully wire the number of data points and what to place inside/outside the loop.
    The problem with shared clock is that I need to sample the AI and AO at different rates but using AO and AI clock separately did not seem to affect the performance.
    I still want to try to use the AO start trigger (as you suggest) because I would like to delay the AI by a few ms from the AO. Is there a simple way to to that?
    I suppose, switching from traditional DAQ to DAQmx requires your brain to be rewired - after playing with it for a couple of days and nights I developed a "feeling" for it. One of the differences was that, in order to use this example in the loop, one has to use 'stop task' inside and 'clear task' outside the loop.
    Thanks again!
    Radek Uberna

  • Error while using Before report trigger. -- Urgent

    Dear All,
    The following error I am getting when I execute my data template where I have used Before Report Trigger. I am also pasting the Data Template that I have developed.
    ============================
    Error
    ============================
    XDO Data Engine Version No: 5.6.3
    Resp: 20560
    Org ID : 204
    Request ID: 4846248
    All Parameters: P_LOB=01:P_DIV_FROM=:P_DIV_TO=:P_FROM_ORG=:P_TO_ORG=:P_INV_FROM=:P_TO_INV=:P_TRX_DATE_FROM="2003/01/01 00:00:00":P_TRX_DATE_TO="2003/01/15 00:00:00"
    Data Template Code: SSBWIPANA_MFGR
    Data Template Application Short Name: WIP
    Debug Flag: N
    {P_DIV_FROM=, P_TRX_DATE_TO=2003/01/15 00:00:00, P_DIV_TO=, P_FROM_ORG=, P_TO_ORG=, P_TRX_DATE_FROM=2003/01/01 00:00:00, P_INV_FROM=, P_LOB=01, P_TO_INV=}
    Calling XDO Data Engine...
    [122407_011745100][][EXCEPTION] SQLException encounter while executing data trigger....
    java.sql.SQLException: ORA-06550: line 2, column 12:
    PLS-00302: component 'P_LOB' must be declared
    ORA-06550: line 2, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 3, column 12:
    PLS-00302: component 'P_DIV_FROM' must be declared
    ORA-06550: line 3, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 4, column 12:
    PLS-00302: component 'P_DIV_TO' must be declared
    ORA-06550: line 4, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 5, column 12:
    PLS-00302: component 'P_FROM_ORG' must be declared
    ORA-06550: line 5, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 6, column 12:
    PLS-00302: component 'P_TO_ORG' must be declared
    ORA-06550: line 6, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 7, column 12:
    PLS-00302: component 'P_FROM_INV' must be declared
    ORA-06550: line 7, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 8, column 12:
    PLS-00302: component 'P_TO_INV' must be declared
    ORA-06550: line 8, column 1:
    PL/SQL: Statement ignored
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
         at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:215)
         at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:967)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3327)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3433)
         at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4394)
         at oracle.apps.xdo.dataengine.XMLPGEN.executeTriggers(XMLPGEN.java:699)
         at oracle.apps.xdo.dataengine.XMLPGEN.processData(XMLPGEN.java:254)
         at oracle.apps.xdo.dataengine.XMLPGEN.processXML(XMLPGEN.java:205)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeXML(XMLPGEN.java:237)
         at oracle.apps.xdo.dataengine.DataProcessor.processData(DataProcessor.java:364)
         at oracle.apps.xdo.oa.util.DataTemplate.processData(DataTemplate.java:236)
         at oracle.apps.xdo.oa.cp.JCP4XDODataEngine.runProgram(JCP4XDODataEngine.java:293)
         at oracle.apps.fnd.cp.request.Run.main(Run.java:157)
    =====================================================
    Data Template
    ====================================================
    <dataTemplate name="SSBWIPANA_MFGR" defaultPackage="PRODUCTION" version="1.0">
    <parameters>
    <parameter name="P_LOB" datatype="charecter"/>
    <parameter name="P_DIV_FROM" datatype="charecter"/>
    <parameter name="P_DIV_TO" datatype="charecter"/>
    <parameter name="P_FROM_ORG" datatype="charecter"/>
    <parameter name="P_TO_ORG" datatype="charecter"/>
    <parameter name="P_FROM_INV" datatype="charecter"/>
    <parameter name="P_TO_INV" datatype="charecter"/>
    <parameter name="P_TRX_DATE_FROM" datatype="charecter"/>
    <parameter name="P_TRX_DATE_TO" datatype="charecter"/>
    </parameters>
    <dataQuery>
    <sqlStatement name="Q_1">
    <![CDATA[SELECT DISTINCT MSI.CONCATENATED_SEGMENTS, MMT.INVENTORY_ITEM_ID,
                    MSI.DESCRIPTION, MMT.TRANSACTION_UOM, SDT.TRX_DATE,
                    MTP.ORGANIZATION_CODE, MMT.ORGANIZATION_ID
               FROM MTL_MATERIAL_TRANSACTIONS MMT,
                    MTL_PARAMETERS MTP,
                    MTL_SYSTEM_ITEMS_VL MSI,
                    SSBWIP_DATE_TEMP SDT
              WHERE MMT.INVENTORY_ITEM_ID = MSI.INVENTORY_ITEM_ID
                AND MMT.ORGANIZATION_ID = MSI.ORGANIZATION_ID
                AND MSI.ORGANIZATION_ID = MTP.ORGANIZATION_ID
                AND MMT.ORGANIZATION_ID = MTP.ORGANIZATION_ID
                AND MMT.TRANSACTION_TYPE_ID IN (17, 44)
                AND MMT.ORGANIZATION_ID IN (
                       SELECT MP.ORGANIZATION_ID
                         FROM MTL_PARAMETERS MP, GL_CODE_COMBINATIONS GCC
                        WHERE MP.MATERIAL_ACCOUNT = GCC.CODE_COMBINATION_ID
                          AND GCC.SEGMENT1 = :P_LOB
                          AND (GCC.SEGMENT2 BETWEEN NVL (:P_DIV_FROM,
                                                         GCC.SEGMENT2)
                                                AND NVL (:P_DIV_TO, GCC.SEGMENT2)
                AND MTP.ORGANIZATION_CODE BETWEEN NVL (:P_FROM_ORG,
                                                       MTP.ORGANIZATION_CODE
                                              AND NVL (:P_TO_ORG,
                                                       MTP.ORGANIZATION_CODE
                AND MSI.CONCATENATED_SEGMENTS BETWEEN NVL
                                                        (:P_FROM_INV,
                                                         MSI.CONCATENATED_SEGMENTS
                                                  AND NVL
                                                        (:P_TO_INV,
                                                         MSI.CONCATENATED_SEGMENTS
           ORDER BY MSI.CONCATENATED_SEGMENTS, MTP.ORGANIZATION_CODE]]>
    </sqlStatement>
    <sqlStatement name="Q_2">
    <![CDATA[SELECT NVL (SUM (TRANSACTION_QUANTITY), 0) COMPLETION
           FROM MTL_MATERIAL_TRANSACTIONS
         WHERE INVENTORY_ITEM_ID = :INVENTORY_ITEM_ID
           AND ORGANIZATION_ID = :ORGANIZATION_ID
           AND TRANSACTION_TYPE_ID = 44
           AND TRUNC (TRANSACTION_DATE) = :TRX_DATE]]>
    </sqlStatement>
    <sqlStatement name="Q_3">
    <![CDATA[SELECT NVL (SUM (TRANSACTION_QUANTITY) * -1, 0) INCOMPLETION
          FROM MTL_MATERIAL_TRANSACTIONS
        WHERE INVENTORY_ITEM_ID = :INVENTORY_ITEM_ID
          AND ORGANIZATION_ID = :ORGANIZATION_ID
          AND TRANSACTION_TYPE_ID = 17
          AND TRUNC (TRANSACTION_DATE) = :TRX_DATE]]>
    </sqlStatement>
    <sqlStatement name="Q_4">
    <![CDATA[SELECT DESCRIPTION
          FROM FND_FLEX_VALUES_VL
        WHERE FLEX_VALUE_SET_ID = 1002470
              AND FLEX_VALUE = :P_LOB]]>
    </sqlStatement>
    <sqlStatement name="Q_5">
    <![CDATA[SELECT DESCRIPTION
         FROM FND_FLEX_VALUES_VL
        WHERE FLEX_VALUE_SET_ID = 1012471
          AND FLEX_VALUE = :P_DIV_FROM
          AND PARENT_FLEX_VALUE_LOW = :P_LOB]]>
    </sqlStatement>
    <sqlStatement name="Q_6">
    <![CDATA[SELECT DESCRIPTION
         FROM FND_FLEX_VALUES_VL
        WHERE FLEX_VALUE_SET_ID = 1012471
          AND FLEX_VALUE = :P_DIV_TO
          AND PARENT_FLEX_VALUE_LOW = :P_LOB]]>
    </sqlStatement>
    </dataQuery>
    <dataTrigger name="beforeReport" source="PRODUCTION.beforereporttrigger(:P_TRX_DATE_FROM,:P_TRX_DATE_TO)"/>
    <dataStructure>
    <group name="G_CONCATENATED_SEGMENTS" source="Q_1">
    <element name="CONCATENATED_SEGMENTS" datatype="charecter" value="CONCATENATED_SEGMENTS"/>
    <element name="DESCRIPTION" datatype="charecter" value="DESCRIPTION"/>
    <element name="TRANSACTION_UOM" datatype="charecter" value="TRANSACTION_UOM"/>
    <element name="INVENTORY_ITEM_ID" datatype="number" value="INVENTORY_ITEM_ID"/>
    <element name="ORGNIZATION_ID" datatype="number" value="ORGANIZATION_ID"/>
    <group name="G_TRX_DATE" source="Q_1">
    <element name="TRX_DATE" datatype="date" value="TRX_DATE"/>
    <group name="G_1" source="Q_1">
    <element name="ORGANIZATION_CODE" datatype="charecter" value="ORGANIZATION_CODE"/>
    <group name="G_ORGANIZATION_CODEC" source="Q_2">
    <element name="COMPLETION" datatype="number" value="COMPLETION"/>
    </group>
    <group name="G_ORGANIZATION_CODEI" source="Q_3">
    <element name="INCOMPLETION" datatype="number" value="INCOMPLETION"/>
    </group>
    </group>
    </group>
    </group>
    <group name="G_LOB" source="Q_4">
    <element name="CF_LOB" datatype="charecter" value="description"/>
    </group>
    <group name="G_FROM_DIV" source="Q_5">
    <element name="CF_DIVFROM" datatype="charecter" value="description"/>
    </group>
    <group name="G_TO_DIV" source="Q_6">
    <element name="CF_DIVTO" datatype="charecter" value="descrption"/>
    </group>
    <element name="CS_COUNT" function="count()" datatype="number" value="G_CONCATENATED_SEGMENTS.CONCATENATED_SEGMENTS"/>
    </dataStructure>
    </dataTemplate>
    Pls. suggest me.
    null

    Hi,
    without checked the whole document .... you've defined all paramaters as datataype charecter instead of character.
    Regards
    Rainer

  • How do i reset a counter in crio scan interface mode

    Hai,
         I am using cRIO 9104 with NI 9421(DI SINKING) module for my counter application in scan mode.
    I have a doubt that how do i reset my counter previous value when my system is in idle mode(i.e stable mode).I tried to use a timeout in property node, But i am not able to put a timeout in my code ,herewith I have attached the printscreen of my program.You can see the timeout option is in hide mode.Any other option is there to reset a counter.Kindly solve this problem and let me know the details.
    Thanks and Regards
    Jayanthi.K
    Attachments:
    Untitled.png ‏292 KB

    You need to get a refnum for the module.  The simplest way to do this is to drag the module in the project onto your block diagram.  It will drop a refnum constant for the module.  You will find all kinds of useful properties and methods on this refnum.  In this case the refnum is of a class named "SD Module" (where "SD" stands for "Specialty Digital") and it has a method on it for resetting counters.  See the attached screenshot of the block diagram.
    Ross Houston
    Senior Software Engineer
    RIO Software R&D
    Attachments:
    reset_counter.png ‏3 KB

  • Sync output timing to hardware trigger (PFI?)

    I'd like to sync the output of my cards (2 PCI-6733 connected with an RTSI cable, and using  BNC-2110's) to the AC power line of the lab I work in. That is, when told to output, they will always wait and output at the same point in the 60Hz cycle.  
    To that end, I've built a circuit that gives a TTL signal that is synced to the building's AC line. I now need to find a way to take this TTL signal and use it as the starter for my experimental sequence. If there is a delay that's ok, however it needs to be a consistant delay (to within a few microseconds preferably). This is so that everytime I run my experimental sequence, I'm starting at the same point in the AC power cycle.
    Is it correct to use the PFI port to try and do this? Other suggestions?
    The sequence would be:
    Step 1: Cards are ready to write
    Step 2: Cards write once, started by hardware trigger of the TTL from the circuit I built.
    Step 3: Other Labview code runs, and then returns to step 1.
    Solved!
    Go to Solution.

    Ok. Knowing about DAQmx export signal is definitely helpful. I don't think I've got everything set up quite right though, as it's giving me an error with what I tried. 
    Error -89136 occurred at DAQmx Start Task.vi:1
    Possible reason(s):
    Specified route cannot be satisfied, because the hardware does not support it.
    Property: StartTrig.OutputTerm
    Destination Device: Dev1
    Destination Terminal: PFI0
    Task Name: _unnamedTask<1E>
    I'm not sure on the correct order of the DAQmx functions. I currently have: Create Channel -> Timing -> Write -> Export Signal (?) -> Start Task. This doesn't seem to be the correct way to do this though. The sample you linked to had the Write after the Start Task... which doesn't quite make sense to me... In addition, I'm not sure where to put the DAQmx Trigger.vi in this sequence.
    Any pointers to set me in the right direction? I've attached a screenshot and vi of my current code to show you what I do now. 
    Attachments:
    Write2PCI6733 (SubVI).vi ‏54 KB
    WriteToPCIscheme_Mar9_2012.PNG ‏59 KB

  • Using a "Sum" Calculated Field on a "Count" query column?

    Here's my query using the Query Report Builder:
    SELECT Col1, COUNT(Col1) AS Count_Column
    FROM Table
    GROUP BY Col1
    It generates a report that lists all the values of column
    "Col1" and how many times each value was used in Col1
    For instance, if Col1 contained the value 'A' 12 times, 'B' 6
    times, and 'C' 19 times, the report would generate this:
    A - 12
    B - 6
    C - 19
    What i need as a column footer is the total count of all the
    values, which in this case 12+6+19=37
    I am using a calculated field, setting the data type to
    Double, the calcuation to Sum, and the perform calculation on to
    'query.Count_Column'. Reset Field When is set to None.
    When I run the report, it doubles the last number in the
    report's Count column (19) and displays 38 on the page. I tested
    this with another column and it doubled the last number in the
    report as well.
    How can I get it to properly Sum my Count_Column?

    Hi,
    You need to check note 208366.1 which explains why totals can be blank. Without knowing the detail of you decode function it is hard to say what needs to be changed. Try putting a sum in front of the decode e.g.
    sum(decode(period, 'Jan period', value, 0))
    Hope that helps,
    Rod West

  • 6221 pulse generation using external digital trigger

    Hi there: I am trying to do something very basic, but cannot figure out how to do it. I have an NI 6221 USB I/O device.  I want to program it to generate a digital output 100ms after receiving a digital input. I am trying to create a task to do this using NI Max, but all of the options on the trigger source menu are greyed out. There is no way to specify an external hardware trigger.  Do I have to program this functionality using DAQmx in the code?

    I found the solution to this question in Gen Dig Pulse-Dig Start.vi from the NI example finder. The answer is that you do need to configure the input trigger programmaticaly using the DAQmx functions. See example code for more details.

  • Is it possible to start a PCI4472 and a PCI-MIO-16E-1 simultaneously using an analog trigger (with pre-trigger)?

    I would like to start several PCI 4472 and a PCI-MIO-16E-1 simultaneously. All boards are connected via a RTSI cable.
    My program works fine if I use software trigger, or an analog trigger from a PCI4472 channel. However, the analog trigger works only when I set pre-trigger (or pre-scan) to 0.
    Is it possible to start a PCI4472 and a PCI-MIO-16E-1 simultaneously using an analog trigger (with pre-trigger)?
    Thanks.
    Ian Ren

    Hi, Bill
    I think it is possible to set more than 38 pre-trigger scans on a single 4472 card. I've done this before. You can verify this by running the Labview example "Acquire N - Multi-Analog Hardware Trig.vi" which comes with LabView.
    What I try to do but without success/luck so far is to start data acquisitions of several 4472 cards and a PCI-MIO-16E-1 card using an anlog trigger (with pre-trigger).
    Thanks for your help.
    Ian

  • Generate a event every X seconds and reseting a counter

    Hi!
    I'm quite newby in programming in Labview and I need your help.
    I've programmed a counter that is send to a MySQL database every time I click a button. Now I want to change this click event to an event ocuring every X seconds and that every time this event occurs it resets the counter. How can I do that?
    I think it's not a difficult question for someone used to programming Labview but I can't find an accurate solution.
    Thanks a lot.
    Solved!
    Go to Solution.

    Something like this?
    Jean-Marc
    Jean-Marc
    LV2009 and LV2013
    Free PDF Report with iTextSharp
    Attachments:
    Automatic event LV86.vi ‏26 KB

Maybe you are looking for

  • How to Handle Special Characters in PI7.1

    Hi Team, I need to handle some special characters like <,>,& etc.. from WS Adapter to CRM in PI 7.1. http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9420 [original link is broken] By using the above blog i had implemented the Java Code as public

  • Error while getting cluster node subtree

    Hi,   We are on SP15. The console logs show the following error log generation timestamp : 2006_01_17_at_17_14_05 java.rmi.RemoteException: Error while getting cluster node subtree of :name=ClusterNodeRepresentative,j2eeType=com.sap.engine.services.a

  • My wife and I have different Apple ID's however when we purchased IPhone 4s and set up our accounts our contacts and apps merged!!! how do we prevent this?

    My wife and I recently purchased IPhones (4S), we use an iMac and an IPad 2, we have separate Apple ID's but when we fired up our new phones and began setting up the systems, our contacts and applications merged. Since then I have disabled ICloud fro

  • Headset iPad 3 Skype

       Hello I have a DR-BT21G Sony headset when Inplay music on skype works perfect but when I use skype sometimes the audio go to iPad speakrs instead the headset and about the voice msgs in Skype simply all play on iPad speakers instead the headset no

  • Vertically spaces between UI elements

    Hi all, How do you set up spaces vertically between different UI elements ? All my UI elements are near each other, I use mainly RowLayout and FlowLayout. Thanks !