How to use Counter/ti​mer PWM Pulse as a trigger to aquire data??

I posted this question on the Counter/timer BOARD, but i got no replies. So i decided to post it here.
(1) I'm using the NI DAQpad 6015 multi-function card with the DAQmx Driver. I'm using the counter/timer (counter 0, and counter 1) to generate 2 different PWM pulses to supply my sensor circuit. each pulse is a 1 second in duration. The pulse with 5m.sec duty cycle is the supply for my sensor. (Imanaged to generate the required pulses). 
In addition to that  I'd like to use the 5 m.sec as a trigger to aquire the sensor reading. The DETECTIN POINT should be the middle of the HIGH State of the 5m.sec pulse (i.e just after the 2.5 m.sec point of the high state). Detection takes place only at the HIGH State of the pulse. How Can i read my sensor voltage for this limited duaration (2.5 m.sec) each time the pulse is high.
(2) another point is: how to display the counter/timer pwm output pulses on the front pannel?? 
Attached is the VI i'm using (Complete PWM.vi), and the pulses diagram
regards,
Attachments:
Complete PWM.vi ‏49 KB
pulse.JPG ‏10 KB

This question has been replied to on this other post.
Thank you,
Raajit L
National Instruments

Similar Messages

  • How to use Counter/timer PWM Pulse as a trigger to aquire data??

    (1) I'm using the NI DAQpad 6015 multi-function card with the new DAQmx Driver. I'm using the counter/timer (counter 0, and counter 1) to generate 2 different PWM pulses to supply my sensor circuit. each pulse is a 1 second in duration. The pulse with 5m.sec duty cycle is the supply for my sensor. In addition to that, I'd like to use the 5 m.sec as a trigger to aquire the sensor reading. The DETECTIN POINT should be the middle of the HIGH State of the 5m.sec pulse (i.e just at the 2.5 m.sec point of the high state).  
    (2) another point is: how to display the counter/timer pwm output pulses on the front pannel?? 
    Attached is the VI i'm using (Complete PWM.vi)
    regards,
    Attachments:
    Complete PWM.vi ‏49 KB

    Hello alaali,
    It sounds like what you need is a trigger delay property node.  This property node specifies an amount of time to wait after the Start Trigger is received before acquiring or generating the first sample. This value is in the units you specify with Start.DelayUnits.  This way you can still acquire using the trigger, and you can specify the delay to be 2.5 ms so that the point that you actually acquire will be 2.5 ms after the trigger.
    Hope this helps.
    Regards,Message Edited by Raajit L on 04-23-2007 04:34 PM
    Raajit L
    National Instruments
    Attachments:
    DAQmx Trigger Delay.jpg ‏6 KB

  • How to use Count with Date Parameters

    Hello,
    I am having issues using the Count() function in conjunction with date parameters.
    This is a Siebel report and in my report I have 2 date parameters(From Date, To Date). In a nutshell I am basically trying to count Opportunities that has a start date within the given date period. However I don't see a reasonable way to put my date parameters within the Count() function. The reason being is that I need to have a huge chunk of code to convert the dates into a common format that can be compared, and it won't even fit within the code block in my rtf template. I am not even sure how to put multiple conditional statements inside a Count() function since all the examples I have seen are very simple.
    Anyone have a suggestion on how to use Count() with date parameters?
    Thanks.

    Any chance you can get the date formats in the correct format from siebel?
    I don't know Siebel - so I can't help you with that. If you get the correct format it is just
    <?count(row[(FromDate>=date) and  (date<=ToDate))?>
    Otherwise the approach would probably need to use string function to get year/monthd/day from the date
    and store it into a varialbe and compare later the same way
    <?variable@incontext:from; ....?>
    <?variable@incontext:to; ...?>
    <?count(row[($from>=date) and  (date<=$to))?>
    Potentially you can use the date functions such as xdofx:to_date to do the conversion
    [http://download.oracle.com/docs/cd/E12844_01/doc/bip.1013/e12187/T421739T481158.htm]
    But I am not sure if they are available in your siebel implementation.
    Hope that helps

  • How to use Counter and variable in xslt

    All,
    How to use Counter in XSLT, and How to do a increament for a count variable?
    How to use a Variable in xslt? and How to define variable inbetween XSLT
    If I am using
    Count=Count+1, its throwin an error ...
    Error: Text is not Supported Under a XSLT Element: $count=$count+1
    Regards
    Francis
    Edited by: Francis on Aug 23, 2012 9:33 AM
    Edited by: Francis on Aug 23, 2012 11:23 AM

    How to use a Variable in xslt? and How to define variable inbetween XSLT
    <xsl:variable name="VariableName">
    <xsl:value-of select='/ns0:SyncItemListEBM/ns0:DataArea/ns0:SyncItemList/corecomEBO:ItemSpecificationGroup/corecom:SpecificationGroup[corecom:Name = "GROUP_NAME"]/corecom:Specification[corecom:Name = "SPECIFICATION_NAME"]/corecom:ValueText'/>
    </xsl:variable>
    How to use Counter in XSLT, and How to do a increament for a count variable?
    You can make use of for-each tag, its simplified in XSLT where you dont need counter if at all needed then you can use of position() to identify the loop counter.
    Thanks,
    Vijay

  • How to use counter output pulses to trigger analog input?

    Hello all,
    I hope the kind people using this forum can help me, a lowly beginner LV programmer! I have been attempting to create a VI that produces a user defined number of TTL pulses, separated by every n seconds. Each TTL would be outputted to a stimulator, which in turn generates its own TTL. Using the stimulator-generated TTL, I would like to trigger finite analog data acquisition (e.g. for every TTL, trigger the collection of a data sweep that contains 4000 samples (collected at 4000 Hz), with 1000 samples collected pre-trigger. I would like to also be able to see each data sweep as it is triggered on a chart. As I understand things (lots of online/book/forum reading), I should be using the counter output to generate my TTL pulses, and syncing each counter produced TTL with analog input, as well as using a reference trigger. Also, the AI part should be started first, so that I don' t miss any counter outputs. If it matters, I also need to use one of the AI channels to acquire the TTL, so I can see my stimulator-induced responses to the stimulator in time.
    I am able to generate the TTL pulses from the counter output, but I am having a problem with the AI part. I am unsure how to sync the counter output with AI. Also, since I need to acquire pre-trigger samples, I would be needing to acquire samples continuously, but when I set 'continuous samples' on daqmx timing, the VI doesn't work (hence why's its set to 'finite samples').
     I hope someone out there can help, as I have been at this for what seems ages, with limited success. I am using a USB-6259 and LabView v8.2. Thanks!
    Attachments:
    RC001 v_1.vi ‏49 KB

    Hello,
    Due to the fact that analog tasks themselves are not retriggerable, a
    pulse train produced by a counter is always used as the sample clock
    for the analog input task in order to recreate a retriggerable effect
    for analog input. This can be done by creating a finite pulse train set
    to retriggerable using the DAQmx Trigger Property Node, or the pulse
    train could be continuous and just be gated by another signal. Neither
    of these methods can be properly applied in hardware to create a
    retriggerable reference trigger. You can however implement something
    similar in software by just stopping and restarting your reference
    triggered analog input task within a loop. There will be some delay
    between when the task is stopped and restarted, as these events require
    software intervention, but if there is enough time between when each
    trigger signal is generated, there should not be any noticeable delay
    or missed samples.
    I have attached an example of this!
    Mark B
    ===If this fixes your problem, mark as solution!===
    Attachments:
    RC001 v_1mod.vi ‏25 KB

  • How to use counter as an start and stop trigger in 6009

    Hi ALL.
    I'm using USB 6009 as a subject of to acquire data.
    I would like to know on how to use the counter digital input as a start and stop trigger. 
    The acquisition will only start when the first pulse of the digital signal is received and it will stop when the desired number of pulse is received.
    I was trying to use the VI as attachment as my reference. However, after tried, the VI is not working for USB 6009 as the counter input cannot be used as a trigger.  
    I would be happy if anyone could suggest me some ideas on this matter.
    Thanks.
    Attachments:
    DigitalStartandStopTrigger.vi ‏32 KB

    Hi Kate. 
    Thanks for your response.
    For your information, I've design my VI using the counter method. However, it doesnt work well. Please see the figure below. The file also attached with this reply.
     At first, the first counter from Device 2 will start counting. If the counting equal 0, then the acquisition for Device 1/AIO also the counter of Device 1/ctr0 begin acquiring data and counting the edges respectively.
    However, when I did the test, it doesn't work as wanted. It is happened because when counter of device 2 in not equal to 0, the acquisition for Device 1 not happened as it will go to false state.
    Is there anything that someone could suggest on how to start the acquisition for device 1 only and if the counter of device 2 is equal to 1. I would like the acquisition of device 1 start only when the counter of device 2 is equal to 1. I cannot use the trigger as 6009 is not support for it. 
    -Fird- 
    Message Edited by Fird on 07-02-2009 04:28 AM
    Attachments:
    Acquire Data Test 4.vi ‏27 KB

  • How to use counter using PCI 6259

    Hello, users,
    I have a PCI 6259 board and use Labview 7.1.
    I'd like to repetitively count the photon signals at 10ms integration time. I want cumulative counts in every 1 sec (1000ms) (or 1 min (60000ms)) And I want to save counts into txt.file which is open in excel program.
    I am a beginner to use counter using PCI 6259 board.
    1. Could you explain default NI-DAQmx counter terminals, i.e., CTR 0 SRC, CTR 0 GATE, CTR 0 AUX, and CTR 0 OUT?
    2. How do I use them or how can I connect to count TTL pulse using PCI 6259?
    3. As I mention my purpose above, which example is the first step to start working my purpose?
    4. If you know good example, could you tell me about that?
    5. If anyone has labview example which is similar to my aim, could you give me some tips or your examples?
    Any hint, comment or advice would be appreciated.
    Thank you so much for your response.
    Leek2

    I have never used the PCI 6259 but have used counters many times with labview, the coding should be the same independent of the board.  What you want to do is finite buffered edge counting using a internal clock.  The best way to do this is to look at the examples programs and use the express vi to get started, then you can use this code to customize your program exactly as you need.
    To address your questions:
    1. CTR0 means "counter 0" the name of the physical resource sometimes listed at GPCTR0.  Each counter has 4 connections to the outside world:
    source "src"(for counting input TTL signals),
    gate (for synchronizing to external clocks and edges),
    out (for pulse-train out operations)
    and aux (specialty operations such as up/down counting and encoding)
    2.For event counting with internal clocking you will only use the src this is the input from the signal you wish to count (ie PMT discriminator for photon counting).
    3,4,5. Look at the count edge examples, there isn't one that does exactly what you want but I have done this with a 6602 (it has e counters) where I use one set of counters to set up a finite pulse train in your case 1000Hz with 1000 pulses, and another counter to edge count on an external pulse, with the source of this pulse routed from the out of the other counter.  Then you can start the task and read when 1000 samples are in the buffer (about 1 second later).
    Hope this helps,
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • How to use count sql statement?

    i've never used the count function and i'm not sure how to use it to print it onto a html page...my code is below...
    <%
    String tot = (String)session.getAttribute("total");
    int total = Integer.parseInt(tot);
    Class.forName("org.postgresql.Driver");
    // create connection url
    String URL2 = "jdbc:postgresql://dbhost/ug59sxn";
    // pass database parameters to JDBC driver
    Connection Conn2 = DriverManager.getConnection(URL2, "ug59sxn", "hupeswop");
    // query statement
    Statement SQLStatement2 = Conn2.createStatement();
    // generate query
    String Query2 = "SELECT COUNT(*) FROM userteam WHERE total > '"+total+"'";
    // get result code
    ResultSet SQLResult2 = SQLStatement2.executeQuery(Query2);
    int position = (int)SQLResult2 + 1;
    %>
    <TD valign=top>
    <P align=center><FONT size=+1>Welcome <%= session.getAttribute("fName") %> <%= session.getAttribute("surname") %><BR>
    Your Team, <%= session.getAttribute("teamname") %>, are currently lying in position <FONT color=red><% out.println(position) %></font>, with <FONT color=red><%= session.getAttribute("total") %></font> points.<BR>
    </FONT></P>
    <P align=justify>      Use the shorcuts on the left to visit different sections of the game.
    You can change your squad around to prepare for forthcoming games (fixtures can be found in the statistics section),
    transfer a player in to your squad to add some depth or replace injured members, or perhaps browse the statistics section to see how your team is doing in the FFL table.</P>
    <HR>
    <%
    SQLResult2.close();
    SQLStatement2.close();
    Conn2.close();
    %>
    i get the following errors:
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    An error occured between lines: 62 and 84 in the jsp file: /main2.jsp
    Generated servlet error:
    /home/students/ug/ug59sxn/servlets-local/work/localhost/myapp/main2$jsp.java:80: Invalid cast from java.sql.ResultSet to int.
    int position = (int)SQLResult2 + 1;
    ^
    An error occurred at line: 88 in the jsp file: /main2.jsp
    Generated servlet error:
    /home/students/ug/ug59sxn/servlets-local/work/localhost/myapp/main2$jsp.java:108: Invalid type expression.
    out.println(position)
    ^
    An error occurred at line: 88 in the jsp file: /main2.jsp
    Generated servlet error:
    /home/students/ug/ug59sxn/servlets-local/work/localhost/myapp/main2$jsp.java:111: Invalid declaration.
    out.write("</font>, with <FONT color=red>");
    ^
    3 errors, 1 warning
    if anyone can help me out, please do so..thanx in advance...

    You cannot cast a ResultSet object (or any other object for that matter) to a primitive (such as an int)
    Replace the following line of code:
    int position = (int)SQLResult2 + 1;with this:
    int position = 0;
    if(SQLResult2.next())
      position = SQLResult2.getInt(1) + 1;
    }Additionally I noticed that you have put single quotes around total in the following line:
    String Query2 = "SELECT COUNT(*) FROM userteam WHERE total > '"+total+"'";Are you sure that the total column in the userteam table is of string type? If not, you don't need the single quotes.

  • How to use Counter B0 and B1 in the same time

    Hi, I am a rookie, and first time post question at here.
    my Card is DAQcard-1200, and data acquisition code is based on MFC of VC6. now I used counter B0 as timer for data sample. how can i use B1 as a suqare wave generator?
    Thank you.

    Hello P.
    The post says that you cannot setup a squarewave generator using B1 unless you provide an external clock; which would not make any sense since you are trying to generate a clock signal. But if you use B0, then the first thing I would advise you to do is read the general purpose timing section of the manual.
    I would then search National Instruments' web site for examples such as this one. You can search for examples in the NI Developer Zone.Message Edited by sergesl on 06-29-2005 02:05 AM

  • How to use Count with other all fields

    Hello guys. Sorry about my question because it s syntax but i didnt find in google.
    How can i use count combined with other all fields.
    Like SELECT count(*) 'other all fields like * '  FROM VBAK .
    Thank you very much.

    Don't sure to understand your requirement (count would always be 1, aggregates are only defined with grouping)
    So either use two SELECT (or replace count(*) counting Nr of records selected) if no relation between count and field values....
    Or use a dynamic SELECT syntax. Use FM DDIF_FIELDINFO_GET to  get field list, then create fieldlist with every field name and count(*), create grouplist with every field name
    SELECT (fieldlist)
           INTO ...
           FROM table
           GROUP BY (grouplist).
    Regards,
    Ramond

  • How to use Counter?

    i have a character Order Number
    Now in report for some set of data i have to show, Number of orders
    i think i need to use Counter in order to do that? yes/no
    how to use that
    lets say for month of January, user want to see the total # of orders for State- California...
    how to do that?
    thnking u

    Hello
    Put your date characteristics in the row, same with the state (unless you want to filter a specific value then, just filter on it without adding it).
    In the column, create a structure (Right-mouse click --> "New Structure")
    Right-mouse click on the "Structure" just added and select "New Formula"
    Use the value "1" as the calculation of this formula and then select the tab "Aggregation", pick the "Counter for All Detailed Values" and as a reference characteristics, pick your "Order Document" characteristics.
    Simple as that.
    Regards,
    John

  • How to use count with decode

    I want to count several categories(say a b c d) under same count and some catogories under another count ..there I need to use count with decode pls let me know the syntacs to write my query..this is ergent
    regards
    Buddhike

    Something like this ?
    select count(decode(your_column,'a',1)) as "a",
           count(decode(your_column,'b',1)) as "b",
           count(decode(your_column,'c',1)) as "c",
           count(decode(your_column,'d',1)) as "d"
    from your_table;But maybe you can give us more details about what do you expected ?
    Nicolas.

  • [WebIntelligence Reporting] How to use count function with condition !?

    Post Author: xuanthuyit
    CA Forum: WebIntelligence Reporting
    Hi everyone,
    I want to make a report like this  with WebIntelligence reporting.
    I want to show the number of Outlet of each chanel (Horeca, Grocery, Convenience) at the end of report !
    But I don't know how to do that with WebIntelligence Reporting.
    Please help asap. . .
    Thank you verry much,

    Post Author: jsanzone
    CA Forum: WebIntelligence Reporting
    xuanthuyit:
    Apparently =count() &#91;and use of a where&#93; was permissible in previous versions of BusObjects, however, things in XI are different (as other users tell me, being XI is my first experience w/ BusObj...), so anyhow, here is the solution to your question.
    You will have have to create two variables for each condition you have.  One variable will be the "helper" and the other variable will be the "worker".  For instance, create a variable called channel_x and the formula:  =if(channel="haney";<metric>;0)  (where "haney" is the name of your organization and <metric> is the metric you are using to count or sum things in your report).  Once channel_x is saved create another variable called channel_x_count and the formula:  =sum(&#91;channel_x&#93;).  Once channel_x_count is saved, then on your report towards the bottom you can use the Template bar to drag in a new table (perhaps you want to use the Horizontal Table type), and then you can drag channel_x_count into your new table.  You will have to repeat the creations of more channel_x type variables (maybe call it channel_y and channel_y_count) or something more descriptive, but in any case substitute the "haney" constant for the next store you want to track, etc, etc.

  • How to use count() function

    Hi,
    Following is XML data
    <?xml version="1.0" encoding="UTF-8" ?>
    <lookup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.oracle.com/lookup lookup.xsd"
    xmlns="http://xmlns.oracle.com/lookup">
    <value>
    <scode>1001</scode>
    <destination>NEO</destination>
    </value>
    <value>
    <scode>1002</scode>
    <destination>NEO</destination>
    </value>
    <value>
    <scode>1003</scode>
    <destination>OFS</destination>
    </value>
    <value>
    <scode>1004</scode>
    <destination>NEO</destination>
    </value>
    <value>
    <scode>1005</scode>
    <destination>OFS</destination>
    </value>
    </lookup>
    I want to count number of occurances of node "value". I have used following expression:
    <assign name="Assign_1">
    <copy>
    <from expression="count(bpws:getVariableData('receiveInput_Read_InputVariable','lookup','/ns3:lookup/ns3:value'))"/>
    <to variable="outputVariable" part="payload" query="/client:ReadXML_Async_PRCProcessResponse/client:result"/>
    </copy>
    </assign>
    But the result of this expression is always 0. Can somebody please point out where I am doing the mistake?
    Regards
    Nitin

    Ntin,
    You could try using the ora:countNodes in built function which should provide the desired effect. I always tend to use this when counting nodes which is what i think you need to do here
    For Example:
    ora:countNodes('HumanTask1_1_globalVariable','payload','/task:task/task:userComment')
    Would count the number of occurances of userComment
    Thinks your would follow the following pattern:
    ora:countNodes('receiveInput_Read_InputVariable','lookup','/ns3:lookup/ns3:value')
    David

  • HOW TO USE COUNTER FUNCTION IN BEX

    RESPECTED ALL
    I WISH TO CREATE A FORMULA KEY FIGURE AT REPORTING LEVEL WHICH SHOULD GIVE ME OUTPUT AS
    1
    2
    3
    4
    5
    6
    7
    THE LOGIC IS " IF YIELD IS GREATER THAN ZERO COUNT 1 ELSE COUNT ZERO AND IN THE NEXT ROW IT SHOULD GIVE ME NUMBER 2 IF IN LINE FIRST IT GETS 1"
    IN A NUT SHELL I WANT TO CALCULATE TOTAL NO OF COILS WHICH DEPENDS UPON TOTAL NO OF YEILD
    FIELD BY USER.
    THANKS
    ABHAY

    Hi Abhay,
    We can get your scenario via calculated key figure..
    Below is the calculated key figure:
    (Nodim(field)<=0)0+(Nodim(field)>=1)*1...     *
    Field represents your perticular key field.in the above cal key fig...if the field is less than or eqaul to 0 counter will show as 0,
    Second condition is if the cal key fig is equal to 1 it will show 1 as the counter.
    In the same way you can implement your scenario...
    Hope this helps you..
    Best Regards,
    Maruthi

Maybe you are looking for

  • My pictures are not showing up

    I recently moved all my pictures on my computer to iPhoto. It was working fine until today when i opened it up. It said it was recovering cache. It shows a ton of blank icons but no pictures. Some pictures work but most of them don't.

  • Problem in Web dynpro Java appl deployment

    Hi Experts, We are in the live environment and after successful QA testing, all the applications were deployed through SDM. In SDM log everything shows as deployed successfully. For one where in the web dynpro screen shows exception message as: faile

  • Do I need to convert 6i form to 10g form

    Hi all, I am currently working on a custom form (version 6i). we have a similar standard form in our project where they applied a patch to that standard form in order to convert it to 10g form and so some additional lines has been added to that stand

  • Error in HTTP to RFC senario?

    Hi experts, iam working on  PI7 sandbox,i done a senario HTTP is the sender and RFC is the Receiver.....where i will send material nunber and i need responce from SAP system unit and weight details.          iam using HTTP client tool 2 post the payl

  • How can I split a document using separator sheets?

    Hi there, as I use s SnapScan-Scanner which is not capable to split a heap of scanned documents at any separator shett in-between I want to create a (apple)script that doese this. Has anybody an idea how to get to the goal?