Syntax for DAQmxRepea​tTask
I want to build a limited oscilloscope for PCI-4474 with four analog inputs and analog-level trigger on one of those four analog inputs. With CVI example "Acq-IntClk-AnlgStart" I have most of the code.
Next with a start- and stop-button, I want that it repeats acquisition of 1000 samples at the analog-trigger, plots the four curves, and goes for the next trigger. The option (that I found in this forum) for DAQmxSetTrigAttribute retriggerable is (according CVI debug information) not supported for this board.
Next (probably not unique) ideais to split the example in a few functions with the use of DAQmxRegisterDoneEvent:
// create task with a.o.
DAQmxErrChk (DAQmxCreateTask("",&gTaskHandle));
DAQmxErrChk (DAQmxCreateAIVoltageChan(gTaskHandle,chan,"",DAQmx_Val_Cfg_Default,min,max,DAQmx_Val_Volts,NULL));
DAQmxErrChk (DAQmxCfgSampClkTiming(gTaskHandle,"",rate,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,gSampsPerChan));
DAQmxErrChk (DAQmxCfgAnlgEdgeStartTrig(gTaskHandle,triggerSource,triggerSlope,triggerLevel));
DAQmxErrChk (DAQmxSetTrigAttribute (gTaskHandle,DAQmx_AnlgEdge_StartTrig_Hyst,triggerHysteresis));
DAQmxErrChk (DAQmxGetTaskAttribute(gTaskHandle,DAQmx_Task_NumChans,&gNumChannels));
// start-button with a.o.
DAQmxErrChk (DAQmxRegisterDoneEvent(gTaskHandle,0,DoneCallback,NULL));
DAQmxErrChk (DAQmxStartTask(gTaskHandle));
// DoneCallback which is called when task has finished the acquisition of its finite number of samples
DAQmxErrChk (DAQmxReadAnalogF64(gTaskHandle, ... ...
DeleteGraphPlot (panelHandle, PANEL_GRAPH, -1, VAL_DELAYED_DRAW);
if( numRead>0 )
for(i=0;i<gNumChannels;i++)
PlotY(panelHandle,PANEL_GRAPH,&(gData ... ...
RefreshGraph(panelHandle,PANEL_GRAPH);
DAQmxErrChk (DAQmxStartTask(gTaskHandle));
This does NOT work unless I insert in this DoneCallback DAQmxStopTask before start the task. This is not what I has expected because the callback function is called because the task has finished. And this is not what I prefer, because the CVI manual reports that stopping and starting a task will reduce the performance. Therefore I have two questions:
Q: can somebody explain (or refer to a text) what the difference is between task-done and task-stopped in combination with task-start?
Q: what is the best syntax for (not yet found) DAQmxRepeatTask when re-trigger is required for synchonisation and when this special attribute is not supperted for PCI-4474?
Regards, Jos
Solved!
Go to Solution.
Hi Jos,
Here's what the NI-DAQmx Help says about task done:
When Is A Task Done?
If the measurement or generation is finite, the task is done when you acquire or generate the final sample or when you call the Stop Task function/VI. If the measurement or generation is continuous (including on-demand timing), the task is not done until you call the Stop Task function/VI. In addition, the task is done if a fatal error is generated while performing the measurement or generation, or you abort the measurement or generation. Check for errors and warnings to verify the task completed successfully.
> This does NOT work unless I insert in this DoneCallback DAQmxStopTask before start the task. This is not what I has expected because the callback function is called because the task has finished.
The callback function is called because the task is finite and the final sample has been acquired. Acquiring the final sample doesn't automatically transition the task from the "running" state to the "committed" state, so you still have to stop the task before you can start it again. See the section of the NI-DAQmx Help entitled "Task State Model" for an explanation of the different states.
> And this is not what I prefer, because the CVI manual reports that stopping and starting a task will reduce the performance.
Yes, but in this case I think stopping is necessary. In other cases, it's not necessary. For example, you wouldn't want to stop and start the task between every sample.
There is a way to reduce the overhead of stopping and starting the task: commit the task by calling DAQmxTaskControl(..., DAQmx_Val_Task_Commit) up front. This way, you don't waste time uncommitting, unreserving, re-reserving, and re-committing the task every time.
Anyway, does the performance meet your requirements? If not, what are your performance requirements?
Brad
Brad Keryan
NI R&D
Similar Messages
-
Syntax for using a variable in an equation.
Hi all,
Simple question here. What is tha appropriate syntax for using a variable in a calculation equation. Specifically, I am taking an established curve fitting equation from my channels and trying to calculate it over a lineargenerated data set to extend the curve beyond the original data sample. Here is the small portion of script I have that will not work. Thanks for any help.
dim a,b,c
a = Data.Root.ChannelGroups(5).Channels("air consumption formula").Properties("ResultApprAnsatzCoef1").Value
b = Data.Root.ChannelGroups(5).Channels("air consumption formula").Properties("ResultApprAnsatzCoef2").Value
c = Data.Root.ChannelGroups(5).Channels("air consumption formula").Properties("ResultApprAnsatzCoef3").Value
Call Calculate("Ch(""[5]/Air Consumption LG"")= ""a"" + Ch(""[5]/LinearGenerated"")*""b""+""c""*ch(""[5]/LinearGenerated"")^2")Hi Gloorious,
I am using diadem script. In my example above, for the equation, if I substitue a,b,and c with numerical values, the script runs just fine and the formula executes as desired. Is there a way to place the variables there instead as I have tried to do (I was hoping it was just a syntax issue) or do I have to approach it a completely different way?
This script will execute just fine:
Call Calculate("Ch(""[5]/Air Consumption LG"")= 4 + Ch(""[5]/LinearGenerated"")*5+6*ch(""[5]/LinearGenerated"")^2")
but this will not:
dim a,b,c
a = Data.Root.ChannelGroups(5).Channels("air consumption formula").Properties("ResultApprAnsatzCoef1").Value
b = Data.Root.ChannelGroups(5).Channels("air consumption formula").Properties("ResultApprAnsatzCoef2").Value
c = Data.Root.ChannelGroups(5).Channels("air consumption formula").Properties("ResultApprAnsatzCoef3").Value
Call Calculate("Ch(""[5]/Air Consumption LG"")= ""a"" + Ch(""[5]/LinearGenerated"")*""b""+""c""*ch(""[5]/LinearGenerated"")^2") -
Syntax for Evaluate function in OBIEE
Hi
I have browsed through the docs but couldn't find syntax for Evaluate function. Could someone pass me the full syntax and if possible a helpful example against essbase.
ThanksHi
definitely
syntax:- EVAULATE('your db function(%1,%2)', parameter list)
here %1 and %2 are the no.of parameters (columns or may constant values) to be passed for the db-function
if you have 3 parameters then you need to use %3 also.. means the columns to be passed.
following exapmples are for ORACLE db,
ex1: EVALUATE('upper(%1)', 'kishore kumar') gives the result as -> KISHORE KUMAR
ex2: EVALUATE('upper(%1)', 'Markets.Region') here Markets.Region is column.
you also can call the user-defined functions through evaulate
EVALUATE('functioname(%1,%2), column1, column2)
the above function has 2 parameters to be inputted
Thanks & Regards
Kishore Guggilla
Edited by: Kishore Guggilla on Jan 16, 2009 11:00 PM -
SQL Syntax for hour/date range in Query
Hi
I am trying to set up an query for sales order documents procesed in the last 30 minutes to be set as an alert to be run every 30 minutes to the sales manager. I am having difficulty getting the syntax for the last 30 minutes
Any suggestions?
Davidhi,
I'm not sure query is correct,but u can modify it futher to get correct one.
SELECT T0.DocNum, T0.DocDate, T0.CardName, T0.DocTotal FROM ORDR T0 WHERE DateDiff(dd, T0.DocDate ,getdate()) = 0 and
DateDiff(Minute,T0.DocTime,' ') <= 30
Jeyakanthan -
FAGLL03 : Submit syntax for dynamic selections
Hi Experts,
My z report contains following fields in selction screen.
1 . G/ L account
2. Comapny code
3. posting date
4. document type
5. layout
In my z report i used following syntax for passing selection screen values to standard program and getting data.
SUBMIT FAGL_ACCOUNT_ITEMS_GL
WITH SD_SAKNR IN S_SAKNR
WITH SD_BUKRS IN S_BUKRS
WITH X_OPSEL EQ ' '
WITH X_CLSEL EQ ' '
WITH X_AISEL EQ 'X'
WITH SO_BUDAT IN S_BUDAT
WITH PA_VARI EQ P_VAR
EXPORTING LIST TO MEMORY
AND RETURN.
The above syntax is not working for dynamic selection field ( document type ), entire document types data is fetching from standard program. I want to fetch document type data based on my z report selection values for document type field.
Expect for document type field , submit syntax is working.
kindly provide submit syntax for my above requirement .
Any suggestions from experts....
thanks & regards,
Hari priya
Edited by: Hari Priya on Aug 24, 2009 4:33 PMHi,
Try like this.
call function 'RS_REFRESH_FROM_SELECTOPTIONS'
exporting
curr_report = 'FAGL_ACCOUNT_ITEMS_GL'
tables
selection_table = i_sel[].
Fill your profit center values in i_sel
Submit FAGL_ACCOUNT_ITEMS_GL with selection-table i_sel and return
WITH FREE SELECTIONS TEXPR AND RETURN
Regards,
Shamma -
Syntax for how to call method of one comp in other comp wd java.
Let us assume,
there is method1 in view1 comp1.
tell me syntax for calling method 1 in view2 comp2
thanks in advance.
Edited by: madhu1011 on Nov 9, 2011 11:31 AMHi Madhu,
This is the situation:
comp1-> method 1 , view1
comp2-> view2
You need to access method1 in view2 of comp2.
For that, do the following steps:
1.) First create a method (for eg: method1) in comp1 (under implementation of view1).
eg: public void method1(){
<......some logic...>
2.)Save the meta data.
3.) In comp2, you will find an option called used components. In that right click and add the component comp2. (Carefully select comp1 itslef).
4.)Save the meta data.
5.) Then go to view2 of comp2 and take implementaion part and right the following logic in wddoinit() (or any other standard or custom method).
wdThis.wdGetComp2Interface().getMethod("method1");
By this way, we can access the method1 of comp1 in comp2.
Regards,
Jithin -
Authentication syntax for HTTP GET method using TCP functions in Labview on linux
Hi,
Currently, I am trying to communicate to web server. I have Labview installed on a Linux machine. The HTTP function blocks and other labview functions do not work. Hence, I am building a HTTP code string using TCP functions (port 80) to talk to the web server. I am successfully able to fetch a response from web sites (example www.ni.com) from my vi. However, when I try to communicate to my web server, it does not work. It requires an authentication. I am able to open http://ipaddress in my browser from my machine using username and password. Can someone help with Authentication string requirement for GET method?
so far the string is:
GET /index/ HTTP/1.1
Host: http://xx.xx.xx.xxAn easy option would be to try http://userassword@server syntax for the URL.
Else I posted a Twitter fetcher once (won't work anymore since Twitter moved to Oauth authentication) at LAVA. Based on code from @cloew.
The code is part of this LLB.
Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be! -
"unsupported syntax for refreshRow ()"
Hi everybody!
I've got a problem with a JDBC-Application I wrote for Oracle 8i. Since migrating to Oracle 9i, it displays after the 10th call to ResultSet.next() an error message "unsupported syntax for refreshRow ()" and it seems to end the connection. Any further requests to the database result in "No more data can be read from socket". I need to logon to the database again to fix this.
I suspect that only 10 lines are cached in the ResultSet. But shouldn't the Oracle thin driver by itself realize if an underrun in the cache appears and rather try to get more lines from the database than display an error message?
I could set the lines fetched at the first attempt to a higher value than 10, but that would only shift the problem.
Any answer is appreciated.
Thanks and regards,
Torstenmy solution was, to change my scrollable result set from sensitive to insensitive type ...
-
Syntax for inserting a single field
hai
can u please tell me what is the syntax for inserting a single field in ztable.
Regards,
N.selvamuthukumar.inserting a single field doesnt make sense if table has more dan one primary keys.
The syntax is
INSERT INTO TABLE VALUES WA_TABLE.
where wa_table is of type ztable. -
Syntax for creating foreign key across users in a database
There are two user present A,B.They are granted all privileges.Now in USER A, there is a table PARENT whose primary key is PARENT_NO.In USER B I have created a table CHILD whose primary key is CHILD_NO.
In the CHILD table of USER B, I want to create a foreign key relation to the PARENT table of USER A.For this I have created a column CHILD_PARENT_NO in the CHILD table.If anybody knows the syntax please post the syntax for creating the required foreign key relationship?Please post your code. Cut'n'paste from SQL*Plus like this...
SQL> conn a/a
Connected.
SQL> desc t1
Name Null? Type
COL1 NUMBER
COL2 VARCHAR2(10)
SQL> grant references on t1 to b;
Grant succeeded.
SQL> conn b/b
SQL> create synonym a_t for a.t1;
Synonym created.
SQL> alter table test add constraint fk foreign key (n) references a_t(col1);
Table altered.
SQL> Note that Oracle will translate the synonym anyway...
SQL> select constraint_name, r_owner, r_constraint_name
2 from user_constraints
3 where table_name = 'TEST'
4 /
CONSTRAINT_NAME R_OWNER R_CONSTRAINT_NAME
FK A T1_PK
SQL> By the way, this ...
GRANT ALL PRIVILEGES TO B;... is a mindbendingly unsafe way of proceeding. In real life you would have given user B the power to utterly destroy your database. It's always easier to start with good habits than to break bad ones so please get used to granting only the minimum set of privileges necessary.
Cheers, APC -
What is the Opendocument syntax for java SDK -BOXI3.1
Hi,
We are using java sdk for BOXI3.1 to open the reports from J2EE Screens.
Earlier we have used below syntax for opendocument in BOXIR2, it worked fine. Now our client is migrated to BOXI3.1 same URL syntax is not working.
BOXIR2 we have used below syntax to open the webi reports from J2EE screen:
URL: "http://" + CMS + ":8080/businessobjects/enterprise115/desktoplaunch/opendoc/openDocument.jsp?" + "iDocID=" + webiID + "&sType=wid&sWindow=Same&token=" + token;
Please help in this regard.The URL path and such has changed.
Here is a pdf for [XI 3.1 URL Reporting|http://help.sap.com/businessobject/product_guides/boexir31/en/xi3-1_url_reporting_opendocument_en.pdf]
Jason -
Syntax for calling html page in PL/SQL package
Hi,
I'm trying to call html page (stored on server) in my pl/sql package!
I have already create html page in pl/sql package code and it's works fine.
Now create better html page (interface design) and stored on server. I would like to call that stored html page in my pl/sql package.
What is syntax for calling html page in PL/SQL or could you suggest me some literature.
In first option I had created ces and stored it on server. Then I call it in pl/sql package like htp.p('<link rel="stylesheet" href="\download\table_style.css" type="text/css">');
I try someting like that for calling html page but it doesn't works.
htp.p('<link rel="form" href="\download\interface.htm" type="text/html">');
Does anyone know syntax for calling html page in pl/sql?!?
Thanks!hello
I normally use htp.anchor(URL,linkname);
it works
ammar sajdi
www.e-ammar.com/Oracle.htm -
What is the syntax for the mdx offset in universe designer?
Hi everybody!!!
I wish someone could help me with my mdx syntax. I made an universe with Universe designer (BOEdge 3.1) from a BW query and I'm trying to create in this universe an object with an offset.
My new object has to be the result of the [0CALYEAR].[LEVEL01] with "- 1" offset, is it possible???
I tried to put the code in the select or in the where fields of the object but without results. When I try to make a query in webi rich client this "new object" doesn't work...
Please help me...
DarioHi Ingo,
thank you for the reply.
I tried to use that document...the problem is when I put the code in the object (inside univ des) and I analyse the code using the button, the syntax is every time without errors. When I try to make the query in webi rich client , if I use that object the software shows a window with error.
I used these code in the "where" field:
1. <EXPRESSION>@SELECT([0CALYEAR].[LEVEL01])-1</EXPRESSION>
2. <EXPRESSION>@SELECT(Anno calendario\L01 Anno calendario)-1</EXPRESSION>
the problem is to find the right syntax for what I want...the -1 offset for the new object from the OCALYEAR. I need that if in webi I select from the object filter [0CALYEAR].[LEVEL01] the value 2010 - in the new object will be 2009 etc...
Dario -
Could someone PLEASE help me on the syntax for URLdecoding?
In the code below, I want to URLdecode the "description" that
I am displaying in the textfield.Can you give us a little more information about the
"description" data that you're trying to display. You could try the
top level function un_escape() (remove the underscore – the
word is censored on this forum).
myHolder.myTextField.text = un_escape(e.target.description);
//again, remove the underscore
TS -
Syntax for NOW() in date function
Hi all
What is the syntax for NOW() in Date function? Can anybody help me..
Thanks&Regards
HemaHere's how I used it.
In VC select an expression box. When creating it, ensure you have the data type DATE selected and provide a field name. If you don't select a date data type, it will not work (the default is text).
In the Data source field section, under the Expression field, select Formula, Under Date Functions select NOW(). You can also format the date
If you want to select yesterdays date, use the following formula:
DADD(NOW(),-1,'d')
Maybe you are looking for
-
How can i install oracle 10g on linux cluster
Dear all: please advice How can i install oracle 10g on linux cluster service .. thanks ,,
-
Hi Everyone. I just bought MacPro and enjoying it very much. I was using the hot corners but now I cannot activate the corners. I am unable to find the Exposé in System Preferences. When i tried to search it, it says that this file does not exist. It
-
I understand that if I go to "File" and then to "Import" I should be able to somehow get all my previous files that where with the Internet Explorer browser relocated to the Mazilla browser...but I don't know how to do that. Give me detailed help ple
-
Hi guys im using cs3 in power mac g5, and when im trying to save an artwork into "Ai" file format, im getting an "unknown error" message, and ive already deleted the com.adobe.illustrator.plist, but still...im recieving the same error. it was working
-
I have a new iphone 5S (I have and used iPhones for years) and am having trouble with my email. I am told that my passwords for several accounts are incorrect. I have checked the passwords and written them in to the mail accounts. I see the check mar