Buffered Data And Counter Reads
Someone help me please....I need to do some fast digital data
acquisition with handshaking, which I think I can figure out. If anyone
has any hints on buffered data like that, please let me know. Also, I
need to read the status of three counters every time that handshaking
pulse comes in. I am not sure how to store the counter data in a buffer
(ie, hardware controlled)
I have to do it hardware controlled, because the DAQ rates have to
be fast....right around 1000 Hz or higher. Can someone offer any guidance
into how to do this? I believe I understand how to configure buffers for
the regular data recording and set up that handshaking, but I'm not sure
how to set up the counters so they write their values to a buffer (all
hardware controlled) when the handshaking pulse comes in.
If there are any books out there or anything, if someone could
tell me, I would be very appreciative. I always get the feelign grad
students are trying to do things that the hardware wasnt designed for. LOL
Thank you.
JP
>Someone help me please....I need to do some fast digital data
>acquisition with handshaking, which I think I can figure out. If anyone
>has any hints on buffered data like that, please let me know. Also, I
>need to read the status of three counters every time that handshaking
>pulse comes in. I am not sure how to store the counter data in a buffer
>(ie, hardware controlled)
> I have to do it hardware controlled, because the DAQ rates have to
>be fast....right around 1000 Hz or higher. Can someone offer any guidance
>into how to do this? I believe I understand how to configure buffers for
>the regular data recording and set up that handshaking, but I'm not sure
>how to set up the counters so they write their values to a buffer (all
>hardware controlled) when the hands
haking pulse comes in.
> If there are any books out there or anything, if someone could
>tell me, I would be very appreciative. I always get the feelign grad
>students are trying to do things that the hardware wasnt designed for. LOL
>
> Thank you.
>
> JP
>
>
>
>
I am working on a project of high speed generation, and what I did was first to
look at the spec sheets of the 6533 (32HS) at www.NatInst.com That is a board
that buffers input and stores it till need be. The 6602 board has counters on
it that can be scanned when events happen. A small bit of math resulting from
those numbers can tell you a lot about when such triggering events happened.
Hope this helps,
Dave
Similar Messages
-
Table for equipement no,measurement position,date and counter reading diffe
hi,
i am looking for tables that could provide me following data :
1) equipement no,
2)measurement position(like working hours,idle hours etc.)
3)date and
4)counter reading difference
I have equipment no.
i have searched table imrg,imptt but not able to find the 2nd and 4th data
plz helpi gt the table IMRG and the field is CDIFF
but its of type F.i want to read it as numeric value that cud be presented to user how cud I -
Union dates and count(*) from different tables
Hope you can help. Using Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
I have tables called apples, oranges, and pears. I want to get a count of all apples, oranges, pears and a total for a date range in one query statement. Any ideas?
for apples the sql is select count(apple_types) from apples where apple_date > TO_DATE('2012-01-01')
for oranges the sql is select count(orange_types) from orange where orange_date > TO_DATE('2012-01-01')
for pears the sql is s elect count(pear_types) from pears where pears_date > TO_DATE('2012-01-01')
EXAMPLE DATA
Data for apples
2012-01-01 4
2012-04-23 1
Data for oranges
2012-02-13 5
2012-03-11 2
Data for pears
2012-01-01 11
I would like the output to be
date count(apple_types) count(orange_types) count(pear_types) total
2012-01-01 4 0 11 15
2012-02-13 0 5 0 5
2012-03-11 0 2 0 2
2012-04-23 1 0 0 1here is one with pivot
WITH apples
AS (SELECT TO_DATE ('2012-01-01', 'yyyy-mm-dd') dt, 4 cnt FROM DUAL
UNION ALL
SELECT TO_DATE ('2012-04-23', 'yyyy-mm-dd') dt, 1 cnt FROM DUAL),
oranges
AS (SELECT TO_DATE ('2012-01-13', 'yyyy-mm-dd') dt, 5 cnt FROM DUAL
UNION ALL
SELECT TO_DATE ('2012-03-11', 'yyyy-mm-dd') dt, 2 cnt FROM DUAL),
pears
AS (SELECT TO_DATE ('2012-01-01', 'yyyy-mm-dd') dt, 11 cnt FROM DUAL),
t
AS ( SELECT dt, SUM (cnt) cnt, 'apples' fruit
FROM apples
GROUP BY dt
UNION ALL
SELECT dt, SUM (cnt), 'oranges'
FROM oranges
GROUP BY dt
UNION ALL
SELECT dt, SUM (cnt), 'pears'
FROM pears
GROUP BY dt)
SELECT dt,
NVL (apples, 0),
NVL (oranges, 0),
NVL (pears, 0),
NVL (apples, 0) + NVL (oranges, 0) + NVL (pears, 0) total
FROM t PIVOT (MAX (cnt)
FOR fruit
IN ('apples' AS apples, 'oranges' AS oranges, 'pears' AS pears))
ORDER BY 1
DT NVL(APPLES,0) NVL(ORANGES,0) NVL(PEARS,0) TOTAL
1/1/2012 4 0 11 15
1/13/2012 0 5 0 5
3/11/2012 0 2 0 2
4/23/2012 1 0 0 1 -
Load Date and Count query implementation in ODI
Hi All,
I have two different questions.
1. How to implement load_date to the SCD Type 2 Dimension tables and fact tables? For the SCD Type 2 Tables do I have to say "Add a new record" for Load date? In the Target store it will be Current_Time_Stamp, is thsi correct?
2. I have the following query I need to add for a column in the target data store.
select SUM(CASE
WHEN CAST(a.LAST_IDP_UPDATE AS DATE) BETWEEN dateadd(month,-6, CURRENT_TIMESTAMP) and DATEADD(day,-1,current_timestamp) THEN 1
ELSE 0
END ) AS six_months_update from transactions;
this will be assigned to six_months_update column in the target. Transactions is the main table in this mapping.
When I use this in the mapping and verify it, it says error. I am not using the keyword "Select" or "AS six_months_update from transactions" in other words the mapping column looks like this
"SUM(CASE WHEN CAST(a.LAST_IDP_UPDATE AS DATE) BETWEEN dateadd(month,-6, CURRENT_TIMESTAMP) and DATEADD(day,-1,current_timestamp) THEN 1 ELSE 0 END )".
How do I implement this? Thanks for your time and help.Hi,
ssk1974 wrote:
1. How to implement load_date to the SCD Type 2 Dimension tables and fact tables? For the SCD Type 2 Tables do I have to say "Add a new record" for Load date? In the Target store it will be Current_Time_Stamp, is thsi correct?In the target datastore you will set the SCD Behavior Type to current timestamp.
> >
2. I have the following query I need to add for a column in the target data store.
select SUM(CASE
WHEN CAST(a.LAST_IDP_UPDATE AS DATE) BETWEEN dateadd(month,-6, CURRENT_TIMESTAMP) and DATEADD(day,-1,current_timestamp) THEN 1
ELSE 0
END ) AS six_months_update from transactions;
this will be assigned to six_months_update column in the target. Transactions is the main table in this mapping.
When I use this in the mapping and verify it, it says error. I am not using the keyword "Select" or "AS six_months_update from transactions" in other words the mapping column looks like this
"SUM(CASE WHEN CAST(a.LAST_IDP_UPDATE AS DATE) BETWEEN dateadd(month,-6, CURRENT_TIMESTAMP) and DATEADD(day,-1,current_timestamp) THEN 1 ELSE 0 END )".
Does the alias "a" on your column match the source table (transactions) alias in the Interface? What error are you getting when it doesn't work?
Regards,
Michael Rainey -
Hello,
I am doing a project that uses MS Access to access data about a baseball team . The MS Access Database provides the names, addresses, and age of the players. All the players are 12, 13, or 14 years old. I need to display the average age for the team on a
label, which was easy. The problem is that I also have to display the number of players who are 12, 13, and 14 years old and I have no idea how to do that.
Here is my code so far:
Public Class frmBaseball
Private Sub TeamBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles TeamBindingNavigatorSaveItem.Click
Me.Validate()
Me.TeamBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.LittleLeagueDataSet)
End Sub
Private Sub frmBaseball_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'LittleLeagueDataSet.Team' table. You can move, or remove it, as needed.
Me.TeamTableAdapter.Fill(Me.LittleLeagueDataSet.Team)
End Sub
Private Sub btnAges_Click(sender As Object, e As EventArgs) Handles btnAges.Click
Dim strSql As String = "SELECT * FROM Team"
Dim strPath As String = "Provider=Microsoft.ACE.OLEDB.12.0 ;" & "Data Source=e:\LittleLeague.accdb"
Dim odaTeam As New OleDb.OleDbDataAdapter(strSql, strPath)
Dim datAge As New DataTable
Dim intCount As Integer = 0
Dim intTotalAge As Integer
Dim decAverageAge As Decimal
odaTeam.Fill(datAge)
odaTeam.Dispose()
For intCount = 0 To datAge.Rows.Count - 1
intTotalAge += Convert.ToInt32(datAge.Rows(intCount)("Age"))
decAverageAge = Convert.ToDecimal(intTotalAge / datAge.Rows.Count)
Next
lblAverage.Visible = True
lblAverage.Text = "The average age of the team is " & decAverageAge.ToString("N2")
lbl12.Text = "The number of 12 year olds is "
lbl13.Text = "The number of 13 year olds is "
lbl14.Text = "The number of 14 year olds is "
lbl12.Visible = True
lbl13.Visible = True
lbl14.Visible = True
End Sub
End Class
I think I should use a For..Next loop but I don't know how to identify and match using this database, and then count how many repeated 12, 13, 14 years old there are.
Any help would be really appreciated.Hello,
Conceptually speaking you would group the data and count. Beings this is school work the demo below is a static example and not suitable for your assignment, its to show a point. Now if you have learned about LINQ and Lambda this logic can apply to your
question but need to work out using this your data which can be done. If not look at using SQL Grouping.
Example of SQL grouping and count
select country, count(country) as count from customers group by country
Module Module1
Public Sub GroupingDemo()
Dim dt As DataTable = SimulateLoadFromDatabase()
Dim TeamData = dt.AsEnumerable.GroupBy(
Function(student) student.Field(Of Integer)("Age")) _
.Select(Function(group) New With
Key .Value = group.Key,
Key .Info = group.OrderByDescending(
Function(x) x.Field(Of String)("Name"))}) _
.OrderBy(
Function(group) group.Info.First.Field(Of Integer)("age"))
Dim dictData As New Dictionary(Of String, String)
For Each group In TeamData
Console.WriteLine("Group: {0} count: {1} ", group.Value, group.Info.Count)
dictData.Add(group.Value.ToString, group.Info.Count.ToString)
' The following is not needed but good to show
For Each item In group.Info
Console.WriteLine(" {0} {1}",
item.Field(Of Integer)("Identifier"),
item.Field(Of String)("Name"))
Next
Next group
Console.WriteLine()
Console.WriteLine("This data can be used to populate control text")
For Each Item As KeyValuePair(Of String, String) In dictData
Console.WriteLine("{0} {1}", Item.Key, Item.Value)
Next
End Sub
Private Function SimulateLoadFromDatabase() As DataTable
Dim dt As New DataTable With {.TableName = "MyTable"}
dt.Columns.Add(New DataColumn With {.ColumnName = "Identifier", .DataType = GetType(Int32),
.AutoIncrement = True, .AutoIncrementSeed = 1})
dt.Columns.Add(New DataColumn With {.ColumnName = "Name", .DataType = GetType(String)})
dt.Columns.Add(New DataColumn With {.ColumnName = "Age", .DataType = GetType(Int32)})
dt.Rows.Add(New Object() {Nothing, "Bill", 13})
dt.Rows.Add(New Object() {Nothing, "Karen", 14})
dt.Rows.Add(New Object() {Nothing, "Jim", 13})
dt.Rows.Add(New Object() {Nothing, "Paul", 15})
dt.Rows.Add(New Object() {Nothing, "Mike", 14})
dt.Rows.Add(New Object() {Nothing, "Jill", 13})
Return dt
End Function
End Module
Output in the IDE output window
Group: 13 count: 3
3 Jim
6 Jill
1 Bill
Group: 14 count: 2
5 Mike
2 Karen
Group: 15 count: 1
4 Paul
This data can be used to populate control text
13 3
14 2
15 1
Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. -
Choosing a value based on newest date, and newest value
Good Afternoon,
I'm in search of help on a statement Im trying to perform in a Query transform in my ETL. So this is the scenario. I have a Value called SGSGVL which is "CYW" and in our descriptions table for the VALUE CYW we have 3 different Descriptions like Cadium Yellow, Cadium Yellow Paint and CDM Yellow and the date the description was added. What I would like to do is say:
Where in the description table = CYW, select the newest date and the most used value.
I've been told I can use a MAX statement but Im unsure exactly how to perform this in the query transform. Can anyone help? It would be GREATLY appreciated!
Thanks!You won't be able to do what you are asking in one query transform - it is complicated due the fact that you need your "max" to be based on something other than the column you want returned (date and count, versus the description). Essentially, what you need to do is:
QUERY1: value, description, field named REC_CNT with mapping of count(*), field named MAX_DATE with mapping of max(date), group by value and description
QUERY2: reads from QUERY1 --> value, field named MAX_REC which has a mapping such as: max(lpad(REC_CNT,'0',5) || '_' || to_char(date,'YYYYMMDD')), and group by value only
QUERY3: also reads from QUERY1 --> value, description, field named THIS_REC which has mapping such as: lpad(REC_CNT,'0',5) || '_' || to_char(date,'YYYYMMDD'), no group-by
QUERY4: joins QUERY2 and QUERY3 on QUERY2.MAX_REC = QUERY3.THIS_REC. Pull the value and description from QUERY3.
Basically - QUERY2 gives you the list of records which are considered the max, and QUERY3 gives you the full list with the same column to be able to join on, so QUERY4 pulls the descriptions only for the max record.
-Trevor -
While publishing using VS 2012 professional to Azure Web Role getting following warning. After this warning even if i waited for hours, publish process never finish and then I have to manually deploy the package on Azure Cloud Instance.
Warning: This request requires buffering data to succeed.Thank you for reply @Will,
I do not have access to my work station computer at this moment. will share the screenshot. Basically what happens is -
1. I start the publish wizard on Windows Azure Project (which as one web role configured)
2. Proceed the publish wizard with advanced options enabled for remote debugging and remote connection enabled.
3. The publish wizard finish and it starts uploading the package and configuration on the azure could service.
4. In the Microsoft Windows Azure activity log pane of the Visual Studio 2012 Professional, after 10-15 minutes it starts showing following warning continously, i even waited for few hours but publish process never completes. Finally i have cancel the publish
process and upload packages and config manually on the azure portal.
Warning: This request requires buffering data to succeed. -
Current Date and Time in JLabel
Hi i am fairly new to Java and i would like to know how i can get a label to show the current date and time ( with seconds) to show up in the top right hand corner.
Thank you.Hi i am fairly new to Java and i would like to know
how i can get a label to show the current date and
time ( with seconds) to show up in the top right hand
corner.
Thank you.You can use TimerTask to do it. also go through the api for Calendar, Date and DateFormat. -
Floating Date and Time icon is gone in Leopard
This may seem like a trivial matter, but under Tiger I was able to have the date and time "Calendar and Clock" Icon on the desktop. It was handy to look at quickly for reference. Under Leopard, I can't seem to get it back. I can have date and time in the menubar, but not the floating icon on the desktop. Did they drop this idea in Leopard?
I saw this hint, but it seems a bit technical to be generally useful.
http://www.macosxhints.com/article.php?story=20071111053947248
A better hint may to enable Dashboard Development Mode
http://www.macosxhints.com/article.php?story=20050422172929402
and find a widget to your liking that displays date and time. -
Quantity of data and Calculation
Hello,
I've a Dataset like that:
Number - Creation Date - Complete Date
10001 - 25 Feb 2008 - 21 July 2008
10002 - 25 Feb 2008 - 26 Feb 2008
10003 - 20 June 2008 - 21 July 2008
I'm looking to have a report counting Month by Month how many data were created and Complete:
Month - Created - Complete
Jan 2008 - 0 - 0
Feb 2008 - 2 - 1
June 2008 - 1 - 0
July 2008 - 0 - 2
Do you have any example of formula to set-up in Crystal Report ?
Thanks in advance
Alex
Edited by: Alexandre VANNIER on Jul 22, 2008 3:29 PMFor the 1st Proposal, I can't do a left outer joined because my extract come from a Java Bean, so the DataSet is unique without any Table link, so I don't know how to generate this Month fields.
Concerning the Second proposal, I don't well understand how to do 2 types of Group,
- I succeed to group by "Create Date" and Count, but I've no clue, how to re-use this count
- How I can group again on a Second Parameter "Complete Date", then count and extract this value
Thanks for your help -
HT5438 Stuck on setting date and time
Apple TV stuck on setting date and time
I read in another discussion that you can turn off your routers firewall temporarily and it will work. I did that. I turned off my apple tv (3rd gen) and then I turned off my routers firewall. Then I turned my apple tv back on and made sure the time setting was set to automatic. Then it let me set my iTunes login and everything was fine. I turned my firewall back on and it all works now. Try that. I'm not saying it will work for everyone, but it worked in my case.
-
MIO 6601 Counter, Perform Buffered Read and Simple Read
I have an application written in C++ where I would like to use the 6601 as the time base for all of the boards, so I would like to be able to query the current value of the counter. I also have a external signal that I want time tagged in the buffer. I have used example programs for the Simple Read and the Buffered read and they both work successfully individually.
If I try and combine them by setting up the counter with the following statement:
iStatus = GPCTR_Set_Application(iDevice, ND_COUNTER_3, ND_BUFFERED_EVENT_CNT);
and try to read the current value of the counter with:
iStatus = GPCTR_Watch (iDevice, ND_COUNTER_3, ND_COUNT, puiCurrentTime);
I always return a 0 for puiCurrentTime.
Can
I do both with a single counter? If not can I synchronize two counters one setup for the buffered read the other for the simple read.
ThanksThe second NIDAQ function call (GPCTR_Watch) will not work with Buffered Acquisition, because it is designed for simple read only. That might be the reason why puiCurrentTime always returns a zero.
Regarding the second issue, you can do both tasks with a single counter, by configuring it as buffered first, and completing the operation, and then configuring it as single, and completing also the operation. Nevertheless, there is no way to configure it as buffered and work with it as single reader, or viceversa. You must use two for performing an operation such as that. Thus, if you want to synchronize both of them, I would suggest you to read the following document which talks about it.
Well, I hope all of this info is helpful for you.
Aguila
Attachments:
Multicounter_Synchronization_App_Note.doc 55 KB -
How to Plot number and string in one row (data logger counter) ?
hi all i made data log quantity using Digital Counter via modbus to monitoring quantity and reject that has and Name Operator, Machine and Part Number.
i have problem about plot the number & string in one row, as shown on the picture below :
how to move that string on one row ? i attach my vi.
Thanks~
Attachments:
MODBUS LIB Counter.vi 39 KBDuplicate and answered - http://forums.ni.com/t5/LabVIEW/How-to-Plot-number-and-string-in-one-row-data-logger-counter-via/m-p...
-
Sychronize AO/AI buffered data graph and measure data more than buffer size
I am trying to measure the response time (around 1ms) of the pressure drop indicated by AI channel 0 when the AO channel 0 gives a negetive single pulse to the unit under test (valve). DAQ board: Keithley KPCI-3108, LabView Version: 6.1, OS system: Win2000 professional.
My problem is I am getting different timed graph between the AI and AO channels every time I run my program, except the first time I can get real time graph. I tried to decrease the buffer size less than the max buffer size of the DAQ board (2048 samples), but it still does unreal time graph from AI channel, seems it was still reading from old data in the buffer when AO writes the new buffer data, that is my guessing. In my p
rogram, the AO and AI part is seperated, AO Write buffer is in a while loop while AI read is not. Would that be a problem? Or it's something else?
Also, I am trying to measure data much larger than the board buffer size limit. Is it possible to make the measurement by modifying the program?
I really appreciate any of your help. Thank you very much!
Best,
JennaJenna,
You can modify the X-axis of a chart/graph in LabVIEW to display real-time. I have included a link below to an example program that illustrates how to do this.
If you are doing a finite, buffered acquisition make sure that you are always reading everything from the buffer for each run. In other words, If you set a buffer size of 5000, then make sure you are reading 5000 scans (set number of scans to read to 5000). This will assure you are reading new data every time you run you program. You could always put the AI Read VI within a loop and read a smaller number from the buffer until the buffer is empty (monitor the scan backlog output of the AI Read VI to see how many scans are left in the buffer).
You can set a buffer size larger than the FIFO
buffer of the hardware. The buffer size you set in LabVIEW is actually a software buffer size within your computer's memory. The data is acquired with the hardware, stored temporarily within the on-board FIFO, transferred to the software buffer, and then read in LabVIEW.
Are you trying to create a TTL square wave with the analog output of the DAQ device? If so, the DAQ device has counters that can generate a highly accurate digital pulse as well. Just a suggestion. LabVIEW has a variety of shipping examples that are geared toward using counters (find examples>>DAQ>>counters). I hope this helps.
Real-Time Chart Example
http://venus.ni.com/stage/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3E95556A4E034080020E74861&p_node=DZ52038&p_submitted=N&p_rank=&p_answer=&p_source=Internal
Regards,
Todd D.
National Instruments
Applications Engineer -
Read Text file and count occurences of certain string
Hello,
I have a text file with lines of data in it. I would like to read this text file and count how many lines match a certain string of text.
For example my text file has this data in it.
dog,blue,big
dog,red,small
dog,blue,big
cat,blue,big
If the certain string of text is "dog,blue,big" then the count would return "2".
Thanks for your helpHello,
Thank you for your post.
I am afraid that the issue is out of support range of VS General Question forum which mainly discusses the usage issue of Visual Studio IDE such as
WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
and Visual Studio Editor.
I am moving your question to the moderator forum ("Where is the forum for..?"). The owner of the forum will direct you to a right forum.
In addition, if you are working with Windows Forms app. please consult on Windows Forms Forum:http://social.msdn.microsoft.com/Forums/windows/en-US/home?category=windowsforms
If you are working with WPF app, please consult on WPF forum:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=wpf
If you are working with ASP.NET Web Application, I suggest that you can consult your issue on ASP.NET forum:
http://forums.asp.net/
for better solution and support.
Visual Studio Language Forums:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?category=vslanguages
Best regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.
Maybe you are looking for
-
Process Multiple Files in Bridge
I am trying to process multiple files in Bridge CS3 using Photoshop Elements 9. It does not give me an error, it just does nothing. Can someone help me figure out how to fix this? It used to do this now I am having problems.
-
Less than more than symbols around fonts fontname
Does anyone know what it means when Illustrator CS shows a font in the font type box with the less than more than symbol ... know the asterisk means a font is missing ... <fontname> is this a permissions indication that the font cannot be embedded le
-
Why has my b210 stopped printing apps. emails and other ok.
i just bought a photosmart b210 and it worked fine. having lots of fun printing stuff off the apps etc. sent an email incl pics and they were fine. now it wont print apps anymore - takes ages and then just goes back to the main menu page. it print fr
-
Can we do risk analysis at org level
Hello experts, can we do risk analysis in sap grc at org levels. sanjay
-
Airdrop works one way but not the other?
There are two Macbook Airs in my house, both new models (one 13" the other 11"). Airdrop appears to work from the 13" to the 11" but not the other way around. The error message in the console is: 29/07/11 11:09:49.684 PM Finder: WormholeClient::didFa