How to count the pulses of an incrementa​l encoder with PCI-6010?
Hi everyone,
I am trying to use an incremental encoder and PCI-6010 card to measure the speed of a rotary shaft in Labview 2011. I need to use the counter to count the numbers of the pulses that the encoder generates but I have some problems there to do so.
I connected the encoder signal to the counter source (PFI0) and built a daq assistant block in the Labview (Acquire signals -> Counter Input -> Edge Count -> ctr0) and it is set as shown in the figure. The problem is that no matter how I turn the shaft the measured value will always be 0 although the pulses can be seen very clearly on the O-scope.
I suppose I must have made a very simple mistake. Could anyone help me on that please?
Thank you.
Hi YShZh,
The current Acquisition Mode setting is set to "1 Sample (On Demand)" and will therefore only ever give you the first count value. The fist count value is equal to the initial count value, which in your case is 0.
Try changing the acquisition mode to either N Samples or Continuous Samples.
Kind regards,
Marshall B
Applications Engineer
National Instruments UK & Ireland
Similar Messages
-
How to count digital pulses?
I am using usb-6501 to read in 12 distinct digital pulses and want to know how to count the pulses. The 6501 has only one counter channel so I am looking for a software/labview program option to count pulses for each channel individually.
Do you need to know when they change or just how many times they changed? Also how fast are they changing?
Mike ...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps -
How to count TTL pulses during 100ms ?
I need to count TTL pulses coming out of an instrument (particule
counter). The pulses appear randomly. I must count how many pulses
appeared in the last 100ms, and so on, every 100ms. I don't want
cumulative counts, but the number of events every 100ms.
I need a hardware clock, so that the counting pace cannot be disturbed
by Windows making some weird, unrequested, CPU-hungry task.
I fact, I need to do that for 2 identical instruments of the same kind,
and I have 2 cards with 2 counters each, total 4 counters. My idea
would be to use 1 counter as the clock for 2 other counters, but how to
trigger the counter value read ?
Thanks.Hi,
In the example I gave you, you need to supply the TTL you want to count the pulse (connected on pin 37) and a TTL "clock" which is connected to PFI0. The TTL on PFI0 permits a hardware timing (100ms for example) to count the edges that occur on the TTL source.
If you do not need hardware timing, have a look at the example attached. You only have to connect the TTL source and the VI counts every 100ms (software timed) the edges that occur durind those 100 ms.
Hope it will help you,
Regards,
David D.
Application Engineer - NI France
01-02-2006 01:26 PM
Attachments:
Compatge des fronts toutes les 100 ms.vi 61 KB -
How to measure the pulse duration of a TTL signal using AI?
Hi there.
I would like to know how to measure the pulse duration of a TTL signal using an Analog input.
These TTL signals comes from an ultrasonic sensor's output. The pulse width of the signal is
proportional to the distance of the object the sensor detected.
I have tried using the example "Measure Pulse Width.vi" which uses a counter to measure the
pulse duration instead. It provides me with correct results.
However, i will like to know how can i do it using the AI instead.
I tried it by using the example "Acq&Graph Voltage-Int Clk.vi" which i modified by including a
timing and transistion measurement vi. Pulse duration was selected as the output. A graph indicator was also added at the output of the pulse duration to monitor the incoming TTL signals.
However, everytime the TTL signals was detected on the graph indicator, the numeric indicator always produce a "zero" reading.
I have attached my vi for your reference.
Can anybody advice me what i have done wrongly?
Regard.
Attachments:
Acq&Graph Voltage-Int Clkv1.vi 190 KBHi Paul,
Today i tried using 2 different methods to read the pulse duration of my sensor signal.
Both methods use "Acq&Graph Voltage-IntClk" vi as a guide.
Method1:
Add a filter vi(lowpass/bandpass) and a timing and transition measurements vi.
Pulse duration is selected as the output. With some numeric conversion, a centimeter
reading indicator was created. However, the reading always remains as "zero"
Method2:
Add a Mask and Limit Testing vi and a timing and transition measurements vi.
By adjusting my upper and lower limits, i manage to "filter" a single pulse out from the actual signal.
However, like the earlier case, the cm reading still remains at "zero"
I have attached both the methods resulted waveforms for your reference.
Are there anything that you can advice on?
Regard.
Attachments:
Results_Waveforms.doc 141 KB -
How to count the number of rows in a resultser object?
hi there
how to count the number of rows in a resultser object which may contains millions of rows? besides using a while loop? thanksYou don't, you execute a query whose result is the record count of those records that match the search and then you execute the actual query to create your record set. Typically you do
select count(id) from YourTable where [filter]
from the resulting ResultSet do
int res.getInt(1);
which gives you the count and then
select id from YourTable where [filter]
to produce the actual result set.
in the second query the id part can be substituted with the actual fields you want. -
How to get the value of Keyboard Increment in illustrator?
Hi! everyone,Good afternoon.
Now I have a painful problem.
How to get the value of Keyboard Increment in illustrator,JS? Like Object > Preferences > General >Keyboard Increment.this will do
var keyboardIncrement = app.preferences.getRealPreference ('cursorKeyLength');
alert(keyboardIncrement); -
How to count the no of digits entered in the NumericField & print the same
Hi!
How to count the no of digits entered in the Numberic Field and print the content of Numberic Field.
Thanks.Hi Venkat,
To check the number of digits, just convert it to a string and use the length() method. to get the number of characters. However, I am not getting your second point of printing the number?
Kindly explain in detail.
Regards,
Poojith MV -
How to count the number of lines dynamically,
In the below code am trying to read the lines which are selected using a check box, also am categorizing the contents depending on the follow up material.
after displaying one category contents am displaying a line
which also counts to a line in the internal table.
My question is how to count the number of lines(ULINE) displayed dynamically.
FORM GET_LINES .
DATA: LV_LINES TYPE I,
LV_TIMES TYPE I,
LV_TABIX TYPE SY-TABIX.
DESCRIBE TABLE IT_REC LINES LV_LINES.
DO LV_LINES TIMES.
LV_TIMES = SY-INDEX .
READ LINE LV_TIMES FIELD VALUE IT_REC-CHECK INTO GV_CHECK.
IF SY-SUBRC EQ 0 AND GV_CHECK IS NOT INITIAL.
LV_TABIX = LV_TIMES.
READ TABLE IT_REC INDEX LV_TABIX INTO GWA_UPDATE.
IF SY-SUBRC EQ 0.
APPEND GWA_UPDATE TO GT_UPDATE.
ENDIF.
ENDIF.
ENDDO.
ENDFORM. " GET_LINESIn the below code am trying to read the lines which are selected using a check box, also am categorizing the contents depending on the follow up material.
after displaying one category contents am displaying a line
which also counts to a line in the internal table.
My question is how to count the number of lines(ULINE) displayed dynamically.
FORM GET_LINES .
DATA: LV_LINES TYPE I,
LV_TIMES TYPE I,
LV_TABIX TYPE SY-TABIX.
DESCRIBE TABLE IT_REC LINES LV_LINES.
DO LV_LINES TIMES.
LV_TIMES = SY-INDEX .
READ LINE LV_TIMES FIELD VALUE IT_REC-CHECK INTO GV_CHECK.
IF SY-SUBRC EQ 0 AND GV_CHECK IS NOT INITIAL.
LV_TABIX = LV_TIMES.
READ TABLE IT_REC INDEX LV_TABIX INTO GWA_UPDATE.
IF SY-SUBRC EQ 0.
APPEND GWA_UPDATE TO GT_UPDATE.
ENDIF.
ENDIF.
ENDDO.
ENDFORM. " GET_LINES
The display function is:
FORM DISPLAY_DATA .
ULINE.
WRITE : /1 SY-VLINE, 'check',
10 SY-VLINE, 'Plant',
20 SY-VLINE, 'Material number',
50 SY-VLINE, 'Follow up material',
70 SY-VLINE, 'Safety stock',
100 SY-VLINE, 'Partc'.
ULINE.
LOOP AT IT_MARC.
MOVE: IT_MARC-WERKS TO IT_REC-WERKS,
IT_MARC-MATNR TO IT_REC-MATNR,
IT_MARC-NFMAT TO IT_REC-NFMAT,
IT_MARC-EISBE TO IT_REC-EISBE,
IT_MARC-PARTC TO IT_REC-PARTC .
APPEND IT_REC.
CLEAR IT_MARC.
ENDLOOP.
DATA: GV_TABIX TYPE SY-TABIX.
LOOP AT IT_REC.
GV_TABIX = SY-TABIX.
READ TABLE GT_TOTAL WITH KEY WERKS = IT_REC-WERKS
NFMAT = IT_REC-NFMAT.
IF SY-SUBRC EQ 0.
IT_REC-PARTC = GT_TOTAL-PARTC.
MODIFY IT_REC INDEX GV_TABIX TRANSPORTING PARTC.
ENDIF.
ENDLOOP.
LOOP AT IT_REC.
WRITE : /1 SY-VLINE, IT_REC-CHECK AS CHECKBOX,
10 SY-VLINE, IT_REC-WERKS,
20 SY-VLINE, IT_REC-MATNR,
50 SY-VLINE, IT_REC-NFMAT,
70 SY-VLINE, IT_REC-EISBE,
100 SY-VLINE, IT_REC-PARTC.
AT END OF NFMAT.
ULINE.
ENDAT.
ENDLOOP.
ULINE.
ENDFORM. " DISPLAY_DATA
Solved -
How to count the number of wins?
I have a tic tac toe simulator that simulates a game of tic tac toe (obviously). I press the 'play' button, and 1 random X and O is placed in 9 of the labels. Then the application says if X or O wins, or if the game was a tie/no winner. So,
what I want to do is when I click the 'exit' button, I want a message box telling the user how many times X won, O won, and how many ties there were. I am not too sure how to count the number of wins.
-ThanksThanks for the reply. I could be wrong, but I do not think that is exactly what I am looking for. Here is the code that I have that determines the winner:
switch (checkWinner())
case 'T':
winnerLabel.Text = "It was a tie!";
break;
case 'O':
winnerLabel.Text = "O Wins!";
break;
case 'X':
winnerLabel.Text = "X Wins!";
break;
private char checkWinner()
char WinnerChar = ' ';
int winning_line = 0;
if (GameBoardCellChar[0].Equals(GameBoardCellChar[1]) && GameBoardCellChar[0].Equals(GameBoardCellChar[2]))
WinnerChar = GameBoardCellChar[0];
winning_line++;
if (GameBoardCellChar[3].Equals(GameBoardCellChar[4]) && GameBoardCellChar[3].Equals(GameBoardCellChar[5]))
WinnerChar = GameBoardCellChar[3];
winning_line++;
if (GameBoardCellChar[6].Equals(GameBoardCellChar[7]) && GameBoardCellChar[6].Equals(GameBoardCellChar[8]))
WinnerChar = GameBoardCellChar[6];
winning_line++;
if (GameBoardCellChar[0].Equals(GameBoardCellChar[3]) && GameBoardCellChar[0].Equals(GameBoardCellChar[6]))
WinnerChar = GameBoardCellChar[0];
winning_line++;
if (GameBoardCellChar[1].Equals(GameBoardCellChar[4]) && GameBoardCellChar[1].Equals(GameBoardCellChar[7]))
WinnerChar = GameBoardCellChar[1];
winning_line++;
if (GameBoardCellChar[2].Equals(GameBoardCellChar[5]) && GameBoardCellChar[2].Equals(GameBoardCellChar[8]))
WinnerChar = GameBoardCellChar[2];
winning_line++;
if (GameBoardCellChar[0].Equals(GameBoardCellChar[4]) && GameBoardCellChar[0].Equals(GameBoardCellChar[8]))
WinnerChar = GameBoardCellChar[0];
winning_line++;
if (GameBoardCellChar[2].Equals(GameBoardCellChar[4]) && GameBoardCellChar[2].Equals(GameBoardCellChar[6]))
WinnerChar = GameBoardCellChar[2];
winning_line++;
if (winning_line == 0 || winning_line > 1)
WinnerChar = 'T';
return WinnerChar;
Do I have to include something extra in here to get the count or no?
The code I posted is the coding in my play button. -
How to count the number of text boxes that are data entered
How to count the number of text boxes that are data entered in visual basic form.
Here is an Iterator that expands on my previous response:
''' <summary>
''' Iterator for form controls
''' </summary>
''' <param name="onlyControlsOfType">specify type if a certain type of controls needed</param>
''' <param name="onlyTopLevel">if true don't search containers within the form</param>
''' <returns></returns>
''' <remarks></remarks>
Private Iterator Function AllControls(Optional onlyControlsOfType As Type = Nothing, _
Optional onlyTopLevel As Boolean = False) As IEnumerable(Of Control)
Dim ctrl As Control = Me.GetNextControl(Me, True)
Do Until ctrl Is Nothing
If onlyControlsOfType Is Nothing OrElse ctrl.GetType = onlyControlsOfType Then
If TypeOf ctrl.Parent Is Form OrElse Not onlyTopLevel Then
Yield ctrl
End If
End If
ctrl = Me.GetNextControl(ctrl, True)
Loop
End Function
Some sample uses:
For Each
For Each c As Control In AllControls()
Debug.WriteLine(c.Name)
Next
List of all controls, including controls in containers i.e. Groupbox
Dim l As List(Of Control) = AllControls().ToList
List of all Textbox controls, including Textboxes in containers i.e. Groupbox
l = AllControls(GetType(TextBox)).ToList
List of all Textbox controls, don't include Textboxes in containers i.e. Groupbox
l = AllControls(GetType(TextBox), True).ToList
'Those who use Application.DoEvents() have no idea what it does and those who know what it does never use it.' JohnWein
Multics
My Serial Port Answer -
How to count the number of AAA clients
Hi,
As we know, ACS5.2 is required with a base license-- supporting 500 network devices.
Sometimes there are lots of AAA clients or network devices that are authenticating simultanious. So my question is, how to count the network devices allowed to auth on ACS5.2? Does that only include network devices, or including both any network devices or AAA clients?
Rgds,
Laowu5017Hi,
ACS 5.x counts the number of AAA clients that are configured on the ACS.
Please note that AAA clients and networks devices is the same and they comply switches, routers, WLCs, or whatever other device configured under
Network Resources >
... >
Network Devices and AAA Clients
AAA Clients are NOT the AAA suplicants.
The end user clients PCs are the AAA suplicants, and for this there is no limit number.
HTH,
Tiago
If this helps you and/or answers your question please mark the question as "answered" and/or rate it, so other users can easily find it. -
How to count the no of record in grid.
Hi Experts,
I have one database block & this is bolck has contain 4 non database item is there. In database block has contain the id and description is non database block item. While i m querying the data description is shown depends up on ID. It is in grid. How to count the no of record in grid. My code is
LV_CUR_ITM :=:SYSTEM.CURSOR_RECORD;
FOR I IN 1.. LV_CUR_ITM LOOP
LAST_RECORD;
SELECT NSN_NO INTO :ORD_DIS_NSN_ITEM_DET.NSN_NO
FROM NSN_MST WHERE NSN_ID= :ORD_DIS_NSN_ITEM_DET.NSN_ID;
SELECT FOB_PRICE INTO :ORD_DIS_NSN_ITEM_DET.FOB_PRICE
FROM PRODUCT_SUPPLIER WHERE PRD_ID_NUMBER= :ORD_DIS_NSN_ITEM_DET.PRD_ID_NUMBER
AND BAS_ORG_ID_NUMBER=:ORD_DIS_NSN_ITEM_DET.ORG_ID_NUMBER;
SELECT DESCRIPTION INTO :ORD_DIS_NSN_ITEM_DET.PRD_DESC
FROM PRODUCT WHERE ID_NUMBER= :ORD_DIS_NSN_ITEM_DET.PRD_ID_NUMBER;
SELECT FULL_NAME INTO :ORD_DIS_NSN_ITEM_DET.SUPP_NAME
FROM ORGANISATION WHERE ID_NUMBER=:ORD_DIS_NSN_ITEM_DET.ORG_ID_NUMBER;
NEXT_record;
END LOOP;
Thx in advance.Hai,
Add a Non database item to that block, and set the Calculation Mode as Summary, and Summary Function to Count.
Then u will get the total no of records from this text. ( You can hide this, so that the use won't see it. )
OR
go to the Last Record, then
LV_CUR_ITM :=:SYSTEM.CURSOR_RECORD; This will also work.
Regards,
Manu.
If this answer is helpful or correct, please mark it. Thanks. -
How to count the number or rows in file
Hi Experts,
I am file as source and Oracle as target. My file containing the some data which is going to load to the target.
My requirement is that I want to count the number of rows which my file contains. Please help me how to count the total number of rows in file.
Thx,
Sahadeva.Hi,
You won't give a name DEST_USER_NAME:ODI will get these information.
it is important Command on source and Command on Source side .
-Pls write jython code on Command on Source side
-And Command On Target side Choose technology as Oracle and set logical schema to HR_logical
Sorry my mistake.İt is related jython syntax.Here is code:
import java.lang as lang
import java.sql as sql
import java.lang.String
import os
lang.Class.forName("<%=snpRef.getInfo("DEST_JAVA_DRIVER")%>")
cons=sql.DriverManager.getConnection("<%=snpRef.getInfo("DEST_JAVA_URL")%>", "<%=snpRef.getInfo("DEST_USER_NAME")%>", "<%=snpRef.getInfo("DEST_PASS")%>")
dblinks= cons.createStatement()
file1=open('EMP.txt','r')
count=0
line=file1.readline()
while line !='':
count+=1
line=file1.readline()
file1.close()
sqlQuery = "insert into HR.ETL_FILE_LOG (FILE_COUNT) values (count)"
rqQuery= dblinks.execute(sqlDBLink)
cons.close()
Regards -
How to check the sales orders that have been created with an Rebate Agreeme
Dear Experts,
Do you know how to check the sales orders that have been created with an Rebate Agreements?
Thanks!!Hi Hoo Laa,
I have one way but little lengthy.
Rebate condition always appears in the billing document.
So 1st you extract the sales order list from Table VBAK.
once you have the sales order list then you can put your order list in Table VBFA --> Extract the billing document list.
Now put that list in the table VBRK.
In VBRK you will get the "Doc. condition" --> put that doc condition in table KONV with your rebate condition type.
It will show the result.
Later, through VLOOKUP you can identify in which order you have given rebate to your customer.
Already said, Little lengthy
Regards,
MT -
HT204074 how to assess the apps i have on my ipad with my iphone 5s
how to assess the apps i have on my ipad with my iphone 5s
If universal, just re-download them to your phone, or sync them from your iTunes library.
Maybe you are looking for
-
Although ePrint connects happily to my wireless Photosmart printer, the All in One app is completely unable to discover it. Please advise how I move forwards.....L
-
How to get the long text into text area
Hi, save_text is working fine . Now I want to display the text in text area . am using read_text fm for this and data is coming into the internal table of the function module. how shd I display that long text into text area and that text shld appear
-
Fuego.runtime.DirectoryException
Hi All, Am getting directory exception when connecting to LDAP. This is not all time but it happens at time. Unable to predict the time of happening. Am using weblogic server 10.3.0 and OBPM 10.3.1 HF #99576 Here are the details of Log. Exception [ja
-
Help!!!! In configuring deploy services
Hi everyone, i want to deploy my application on to some location other then the default StandardApplicationSeference that is .../cluster/apps/sap.com/ say suppose c:/sampleAppli/ and from there only want to start the server through s
-
Not Able To Open Forms Session After Developer 6i patch
Hi, Our enviroment is Db version --> 9.2.0.6 EBS version --> 11.5.10.2 We are upgrading our db to 10gr2.As a prerequisite developer 6i patch (patch 19) has been applied. After this patch, some forms could not be opened .No error or anything observed