How to trigger a counter with AI input
Hi,I have a question on how to trigger a counter with AI input.We are using a DAQ board with two counters(counter 0 & 1),and we have an external synchronization signal input at a frequency of 50 Hz or so.The counter is set to event counting mode.Now we want to trigger one of the counters so that the counter starts a new counting process each time it detects a rising/falling edge from the sync signal.Can anybody kindly show me how to achieve this?Thanks a lot.
Regards
Verdi
Verdi,
I think that the behavior you are looking for can be achieved by configuring the counter for buffered period measurement. The counter starts counting from some initial value with each rising or falling edge on the gate. You could also use buffered event counting, but the count value will not reset with each edge on the gate. I don't know what you're using to program the board, but you could start by looking at the counter examples that are installed with NI-DAQ.
Hope this helps,
Erin
Similar Messages
-
How can i control graph with two inputs?
Hi,
i would like to ask you about the graph with two inputs
Normally, if i just give one input, they generate the graph with this input(y) vs time(x).
But now i would like to get the graph with my two inputs in x axis and y axis .
i want to control both of two axis. How could i do for it ?
i attached the file that i try to use "Build XY graph" to control both x and y axis with random number .
It can run but i don't know how come the graph show nothing. .
Actually , it have to show something like wavefrom continuously. am i right?
Could you tell me a way to solve it ?
>>>
what i want to get is ..
in Graph,
for x axis , ditance (always increases)
for y axis , vibration (vary)
>>>
Thank you so much for your time . I am looking forward your kindly reply.
With Respect,
Su
Attachments:
using Build XY graph.vi 59 KBHi NI9233,
Mind me to interrupt, I am just helping Mike to explain what he meant to you, refer to the graph:
Picture 1:
Double click on Build XY Graph, uncheck the clear data on each call
Picture 2 and 3:
Change your formula node into +1 Basic Function in Functions Pallette.
Hope that helps!
PS: I am sorry for the size of the image, seems I made a mistakes when I saved the picture.
Sincerely,
Krisna Wisnu
Message Edited by Krisna Wisnu on 11-19-2008 08:19 PM
Sincerely,
Krisna Wisnu
Attachments:
Clear Graph on Each Call.PNG 46 KB
+1.PNG 30 KB
+1_2.PNG 21 KB -
Pulse counting with voltage input
Im using compact field points analog I/O (AI-112) to measure the frequnecy of an anamometer.
Basically the sensor is just a switch that open/closes at a frequency which gives 1 pulse per second (1Hz = 1.25MPH).
I know the pulse counter I/O would be best for this, but I assume labview with realtime should be able
to handle this measurment. Im having trouble finding the right VI's to do the job. Any suggestions for
possible ways to count the pulses/ measure the frequncy would be appreciated.Hello cfpboy,
I have a question about your signal first. How long does your signal remain changed when a pulse occurs? Does the signal stay "high" for 1 full second and then go "low" or does it pulse "high" once a second and then immediately return to "low". If it stays "high", then you could simply poll the input in a LabVIEW Loop set to occur once a second. You could then store the value in a shift register, and compare the current value to the previous value. If they are different, then the state has changed, and you could then increment your software counter. As you are using an analog input module, you will want to convert your voltage level to a "digital state" by checking if it is above or below a specified level.
One drawback of this approach is long term phase shifting as well as the possibility of reading while in a transition state. This could potentially throw off your measurements. As you are using LabVIEW Real Time, you can slightly mitigate some of these problems by utilizing a LabVIEW Timed Loop instead of a normal Loop.
Thanks,
Jonathan C
Staff Application Engineering Specialist | CTD | CLA
National Instruments -
How to do a count(*) with Jena Adapter?
Hi, I am trying to do a count(*). I know it's not part of the SPARQL 1.0 standard, but it is supported in ARQ, and presumably by the Jena Adapter too then?
Other examples I have been able to find do an iteration over the resultset to get a count, but that is not acceptable since I have millions of triples. In my tests it took 15 seconds to return the count by using iteration. Oracle Semantic is advertised as scaling to "hundreds of millions of triples"; so how do I do a simple count(*) aggregation?
Below is the code I tried. It works with a regular jena default model, returning the expected result of "2", but the result is empty if I use the Oracle Jena adapter.
import oracle.spatial.rdf.client.jena.ModelOracleSem;
import oracle.spatial.rdf.client.jena.Oracle;
import com.hp.hpl.jena.graph.Node;
import com.hp.hpl.jena.graph.Triple;
import com.hp.hpl.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory;
import com.hp.hpl.jena.query.ResultSet;
import com.hp.hpl.jena.query.ResultSetFormatter;
import com.hp.hpl.jena.rdf.model.Model;
public class OracleJenaAdapterCountTest {
public static void main(String[] args) throws Exception {
String szJdbcURL = "jdbc:oracle:thin:@dragon12:1521:mydb";
String szUser = "mydb";
String szPasswd = "yeahright";
String szModelName = "kp_mydb_model";
Oracle oracle = new Oracle(szJdbcURL, szUser, szPasswd);
Model model = ModelOracleSem.createOracleSemModel(oracle,
szModelName);
// this one works
//Model model = ModelFactory.createDefaultModel();
model.getGraph().add(
Triple.create(Node.createURI("http://example.com/John"),
Node.createURI("http://example.com/fatherOf"),
Node.createURI("http://example.com/Mary")));
model.getGraph().add(
Triple.create(Node.createURI("http://example.com/John"),
Node.createURI("http://example.com/fatherOf"),
Node.createURI("http://example.com/Bob")));
Query query = QueryFactory
.create("select (count(*) as ?count) {?f <http://example.com/fatherOf> ?k .}");
QueryExecution qexec = QueryExecutionFactory.create(query, model);
ResultSet results = qexec.execSelect();
ResultSetFormatter.out(System.out, results, query);
model.close();
oracle.dispose();
}Hi,
Which version of Jena/Jena Adapter are you using?
I am a bit surprised that your query did not throw out an exception. I need to set Syntax.syntaxARQ
in the query creation, as follows. (Without it, I got com.hp.hpl.jena.query.QueryParseException when
executing the same code.)
Query query = QueryFactory
.create("select (count(*) as ?count) {?f <http://example.com/fatherOf> ?k .}",
Syntax.syntaxARQ);
Once I have the above change, I did get the right count.
| count |
=========
| 2 |
The above query is not the most efficient one in terms of getting the count. Because we have to select out all projection and send the data from the database to the Java client. If you are using the latest Jena Adapter, you can use the count_only which will instruct the underlying query to return the count directly from the database.
Query query = QueryFactory
.create("PREFIX ORACLE_SEM_FS_NS: <http://oracle.com/semtech#count_only> select ?count {?f <http://example.com/fatherOf> ?k .}",
Syntax.syntaxARQ);
Cheers,
Zhe Wu -
How to create a counter (with fixed increment) in DME file
Hi Experts,
Is there a way to define a counter in one of the Segment/loop of DME (Such as number of invoices), where we have to increment the actual value of the counter reading by a fixed value, say 2. Example, if the counter can print the invoice numbers as 1,2,3, 4,5 etc. then it should rather print X+2 in each case, i.e. 3, 4, 5, 6, 7 and so on.
Regards
HarshHi Amitash,
Thanks for the response. Sorry I couldn't articulate my question correctly. Let me try to rephrase.
I have to print all the invoice details related to each payment document, in the DME output. One of the field in the invoice details is a simple counter, which prints a simple sequence number 1 to 5 (for 5 invoices). This counter can go upto any number depending on the number of invoices (1 to n). Now with the help of aggregation functions I am able to generate such a counter. But here is the twist now. Instead of printing 1 to 5, the counter should print 3 to 8. ( i.e. 1 to n, it should be printing 3 to n+2 ). Is that possible?
Regards
Harsh -
i want to create a table that has 2 angles (beta and theta) that could assume values from 0 to 180º and gamma that is given from a sensor to the table at every moment... all angles depend of each other and i want a table that demonstrates that. so i can pull a data to use it in a equation. can someone help with this mess?
alufe wrote:
I have to make an array for each angle and connects them?
That's one way. You end up with multiple 2-D arrays. You also could make a 3-D array to iterate through all your beta/theta arrays, calculating a gamma for each pair, if you understand arrays of multiple dimensions. You seem to indicate a major shortfalling in your math skills here, so I'll repeat, work with your teacher until you can understand the math, and then work on the programming.
You have to know what you want to do before you can do it. In this case, you have to know what that array represents, and how (I'm talking math now) you are going to determine/represent the one set of numbers you need to work with for each experiment before you set something up in software.
Cameron
To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.
To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
LabVIEW Unit 1 - Getting Started
Learn to Use LabVIEW with MyDAQ -
How to play analog sound with PC input
Hello,
I have connected a pc to the pc input (VGA sub D15) in my TV 46TL933. I am looking to connect the analog audio output from the pc into the TV. I already tried to connect the audio signal to the component input, but the tv doesn't listen that input when switched to pc input. How to play sound from pc on the 46TL933 TV ?
Thank you in advance for everyone who helps me.
Kind regards
JohnThat doesn't appear to be a US model, and this is the forums for Toshiba USA. You may want to contact Toshiba in your region.
- Peter -
How to use Flash Encoder with an input file?
In WME I can stream a file input (no capture device). How can I do this in FME, which only looks for a capture device? Thanks.
On that note, using an audio mixer, can you mix in voice from a mic into the signal? so you could select/mix from mic or movie audio?
If you try that let me know how it works, because while I can now get the audio from the movie playing, the mic input is used up and so no other audio available. Maybe a mixer like you have would work.
Best wishes,
Adninjastrator -
How to design Digital Voltmeter with Transducer input
I want to know the design for voltmeter
Hey there,
Is there a particular NI DMM design you're curious about? Here are a few design overviews for our PXI-407x family, and here's a higher level overview of our DMM offerings. For additional details, let us know what information you're looking for.
-John Sullivan
Analog Engineer -
Count of records input via MM01
How can we do count of records input via MM01?
Thanks,
APHi,
it depends of using MM01.
MARA, MARC, MARD, MVKE etc.
regards, Dieter -
How to trigger a TTL output with an analog input
Hello,
I have an apparatus for measuring the flame speed of various hydrocarbon/air mixtures. The chamber uses central ignition as the means for igniting the mixture. My goal is to film the ignition process with a high speed Phantom video camera. I control the ignition with an analog output signal from a SCC-68 DAQ. I would like to trigger the camera with the same signal that triggers the ignition sequence. The camera is triggered with one TTL pulse so ideally I would connect the output analog voltage signal to an input analog voltage port that would be used to trigger a counter output that generates one pulse.
I have a sample VI that triggers a digital pulse each time the analog trigger level is met and it works for what I am trying to do but I do not understand how the two channels are connected. I also can't figure out how to make the VI end after just one pulse. In the VI the digital counter is supposedly triggered using the /Dev1/ai/StartTrigger slot on the DAQ but nothing is connected to this slot.
I need to first figure out how to make the output_pulses_on_sine_wave.vi terminate after a single pulse is generated. Then I can try to incorporate it into the VI that I use to control the ignition and measure the temperature and pressure once the mixture is ignited.
John
Attachments:
output_pulses_on_sine_wave.vi 27 KBI am using the USB-6259, sorry for the confusion. I would be nice if I could trigger with an analog signal to the ignition system but it is controlled with a high voltage relay that operates when 12 volts are supplied to it. It really isn't a trigger as much as powering on the high voltage relay. To control it, I have a 12 V supply line that is switched closed using a SCC-RLY module. Could I somehow connect the 12 V supply to one of the buses and use a digital trigger to supply the 12V on command to the high voltage relay?
Thanks for the quick response. -
How can I implement a Digital I/O counter with a maximum source frequency of 80 MHz (like 6602 board) using CompactRIO? It appears as if the Digital I/O modules for CompactRIO are much slower than this.
Thank you,
--RayHi Ray,
The highest frequency input we offer for C Series modules is 20 MHz if you are doing LVTTL and 10 MHz for 5 V TTL. These modules are the 9402 and 9401, respectively. Unfortunately, there is no 80 MHz input on this form-factor.
Regards,
Chris E.
Applications Engineer
National Instruments
http://www.ni.com/support -
How to convert the counter input as a RPM
Hello NI,
Could you tell me. how to convert the Counter input to the RPM. I am using Rotary encoder has a 5V amplitude with 500 PPR. i am going to measure the Engine speed as a rpm.
I am using third party hardware, from the hardware i can get the Count as well as Frequency also.
Could you suggest to me...? i looked out some disscussion in these forum but i cant able to understand.
can you please explain with simple way....
if you have any simulation send me....
Regards,
Balaji DPHi balaji,
[email protected] wrote:
...I am using third party hardware, from the hardware i can get the Count as well as Frequency also.
If you're able to read frequency as X pulses/sec(?) that seems to convert RPM as follows:
X (pulse/sec) * 1/500 (rev/pulse) * 60 (sec/min) = X * 60/500 RPM (???)
Cheers!
"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare) -
Edge counting with digitial pause trigger
Hi
I should write a program for edge counting with digital pause trigger in visual basic. I have found an example of using pause trigger in edge counting but it is written in C#.
Steps in the program followed is:
1) creating task
2) creating count edge channel objecy
3) configuring thr trigger ( where i have been strucked)
code in c # is:
taskname.triggers.pausetrigger.digitalleveltrigger ( source, level)
When i tried to look for trigger function and to configure it in Visual Basic, I have not found any trigger function to set/configure in the function library
ThanksHi there,
Here is the code in text format. That's pretty much all you need. I took the example code called CntDigEvents.vbp and added the following code before the start task function call:
DAQmxErrChk DAQmx.DAQmxSetPauseTrigType(taskHandle, DAQmx_Val_TriggerType6_DigLvl)
DAQmxErrChk DAQmx.DAQmxSetDigLvlPauseTrigSrc(taskHandle, "PFI0")
DAQmxErrChk DAQmx.DAQmxSetDigLvlPauseTrigWhen(taskHandle, DAQmx_Val_Level1_High)
As for the C# code I am not familiar with C# so I don't think I can be a great help on that one.
myTask.Triggers.PauseTrigger.ConfigureDigitalLevelTrigger(triggerSourceTextBox.Text, gateLevel) This function is the main call for the pause trigger and all it is doing is setting the properties. triggersource should be along the lines of "PFI0" or "Ctr0" and gate level defines whether the gate level is "high" or "low)
How is the VB code going?
AdamB
Applications Engineering Team Leader | National Instruments | UK & Ireland
Attachments:
VBcode.txt 4 KB -
How to trigger New page while using ALV with classes/oops?
Hi All
I am trying to print a report which has to show the data in two pages.
I am using ALV with classes/oops.
Though I am able to print the report but a new page is not coming. Whole of the data is coming in one single page.
Please tell me as to how to trigger a NEW PAGE while using ALV with classes/oops.
Please send some code samples also if available.
Thanks in advance.
Jerryusing sort option you can do it. in case of grid/oo alv class ALV you can view that only in print mode/preview mode.
in case of list you can view that directly.
sort-fieldname = 'FIELDNAME'.
sort-group = '*' "triggers new page
sort-up = 'X'.
append sort to it_sort.
Maybe you are looking for
-
Automator - How do I: Mouse Click, Move Windows, and more
Hello, I am attempting to create my own Automator programs and for a while I had some that worked nicely. I have recently been tweaking my iMac so that it can "think" on its own (by automator of course) and do things for me. However, I've run across
-
Is there a way to have extended panning from picture to picture
Hi all, I am looking for some suggestions here. I would like to make a video of multiple pictures (30 or more pics) slowly sliding from left to right throughout a whole movie. I would really like to somehow crop the edges too so they streamline nicel
-
How do I fix i-tunes on my pc when I get a message that msvcr-80.dll is missing? When I try to reinstall I get a message that I need to document that I am authorized.
-
Question: one weblogic server listening on several port
can i start one weblogic server that listening on several port, one for different application? for example, 7001 for general user, and 7005 for admistrators and ask for two way authentification? can i do this? or do i have to start two weblogic insta
-
IPod won't sync after restore - now iTunes freezes up and iPod is empty
Two days ago my iPod started acting up - playing a song for about the first 10 seconds, then freezing up. I did the 5 R's - many, many resets, switching the USB port, reinstalling the software, and several restore attempts. The new and more pressing