How to acquire and read data before trigger?
Hi, all:
I want to acquire a impluse signal, and the data when the signal begins is very important to me. So, I want to using a digStart trigger to acquire it, but then i'll lose what i want, maybe i can acquire it continuously, and use the trigger to start read the buffer after a delay(in order to wait the signal end), i don't know if there is any ANSI C functions I can use to do it in this way. I am using PCI6220, DAQmx9.02 and ANSI C. If anyone have some info on this please let me know. thinks.
Hi Cris Brown:
From your application,I suggest that you can use DAQmxCfgDigEdgeRefTrig function; define pretrigger samples fitting for your application.
Try it. Best Regard!
Similar Messages
-
How to write and read data in a specific memory location ??
Hi Everyone:
Does anyone know how to write and read data in a specific memory location by using Java ?
I need pointers, but I don't know how to do it ??
Thanks for answering
RodgerHi Everyone:
Does anyone know how to write and read data in a
specific memory location by using Java ?
I need pointers, but I don't know how to do it ??
Thanks for answering
RodgerWith Java you cannot write to a specific memory location. Java does not have pointers. If you really want to do it, you need to use JNI, i.e write the required functions in C (or other languages that support pointers) and make those functions available to Java (through JNI). This approach is not portable. You can have a look at http://java.sun.com/docs/books/tutorial/native1.1/index.html
Regards. -
How to open and read data from text file in PL/SQL
We have a project ,need to open a file containing entries of data
,then process those data records one by one to update the
database.This operation shoulbe be done in the database
enviroment. Is there any hint about the file operation in
PL/SQL? How to open the file and get one record ,maybe one line,
and parse and get the data field ?
thanks
defangThere was also a question on this over at AskTom
(asktom.oracle.com) about a week ago complete with sample code.
The pointer to the sample code is here:
<A HREF="http://asktom.oracle.com/pls/ask/f?
p=4950:8:::::F4950_P8_DISPLAYID:464420312302
TARGET=_blank>http://asktom.oracle.com/pls/ask/f?
p=4950:8:::::F4950_P8_DISPLAYID:464420312302</A>
Admittedly it's about Win95, but the principles should apply.
Yours faithfully, Graham Reeds.
[email protected] | http://omnieng.co.uk/ -
How to acquire and display data from labview to excel simultaneo​usly
hello,
I am using the NI-DAQ to measure the falling edges of a clock and display them into a table. What I need is to display these data in a table in excel while the program is running. In addition, when I receive a pulse from an external clock, for which I have created a digital channell, the data must be logged in a different column. In other words, every time I receive a pulse the data must be stored in the adjacent column in excel.Hello Evangelos,
As far as I know and have experienced, it is not possible to access a spreadsheet file (or any file, for that matter) by two programs at the same time, you will get an error.
Also, a couple of observations on your code:
A constant wired to a case selector of a case structure makes no sense as the false case will never be executed.
Move the DAQmx Read from your Digital Input task into the while loop, as the DAQmx Read will only read once and the wire won’t get information in or out of a while loop as long as the while loop is iterating.
Regards,
Daniel REDS
RF Systems Engineer
Help us grow.
If a post solves your question, mark it as The Solution.
If a post helps, give Kudos to it. -
"I want to acquire and display data from 89C51 micro controller using RS 232 port"
I am using 89c52 for data acquisition and control for photo diode array. I would like to do the same using RS-232 and micro-controller 89c52. I would like to generate two different control pulses (clock and trigger) and I am digitizing my analog data using on-board ADC, the data for which I would like to read using Labview and store it in a file also display the waveform of acquired data. Please reply.
Nice project, we do that all day long here. What is your problem exactly?
The 89C52 has a UART you can use to write commands and read data. It is fairly straightforward to write a command processor for the uC and implement a command set. Is it the computer or the uC that generates the control pulses?
LabVIEW, C'est LabVIEW -
how to find and replace data in form fields in acrobat xi, its not allowing to do so while trying, asking for adobe livecycle to get installed. please help.
Easiest way to do it is the following:
- Open the PDF file in Acrobat.
- Go to Tools - Forms - More Form Options - Export Data.
- Save the form data as an XML file somewhere on your system.
- Open XML the file in a plain-text editor (I recommend Notepad++).
- Let's say you want to replace all the years in the dates from "2013" to "2014". Do a global Search&Replace of "2013-" to "2014-" (I added the dash just to make sure that only date fields are edited).
- Save the XML file (maybe under a new name).
- Go back to the PDF file, and now go to Tools - Forms - More Form Options - Import Data.
- Select the edited XML file and import it.
- Done! -
How to acces and display datas storaged in cache for a SUP 2.0 workflow?
HI to all.
I have an application with a item menu which obtains data thought a online request. the result is shown is a listview.
My problem is when my BlackBerry has no conection ( offline scenario). When I select the menu item, I obtain an error.
How to acces and display datas storaged in cache for my MBO? I have read that I can use getMessageValueCollection in custom.js to access to my datas but once I get the datas, How can associate those datas to a Listview like a online request?? Do i have to develop my own screen in html or how?
Thanks.I'm not entirely clear on what you mean by "cache" in this context. I'm going to assume that what you are really referring to is the contents of the workflow message, so correct me if I'm wrong. There is, in later releases, the ability to set an device-side request cache time so that if you issue an online request it'll store the results in an on-device cache and if you subsequently reissue the same online request with the same parameter values within that timeout period it'll get the data from the cache rather than going to the server, but my gut instinct is that this is not what you are referring to.
To access the data in the workflow message, you are correct, you would call getMessageValueCollection(). It will return an object hierarchy with objects defined in WorkflowMessage.js. Note that if your online request fails, the data won't magically appear in your workflow message.
To use the data in the workflow message to update a listview, feel free to examine the code in the listview widgets and in API.js. You can also create a custom listview as follows:
function customBeforeNavigateForward(screenKey, destScreenKey) {
// In this example, we only want to replace the listview on the "My Approvals" screen
if (destScreenKey == 'My_Approvals'){
// First, we get the MessageValueCollection that we are currently operating on
var message = getCurrentMessageValueCollection();
// Next, we'll get the list MessageValue from that MessageValueCollection
var itemList = message.getData("LeaveApprovalItem3");
// Because its a list, the Value of the MessageValue will be an array
var items = itemList.getValue();
// Figure out how many items are in the list
var numOfItems = items.length;
// Iterate through the results and build our list
var i = 0;
var htmlOutput = '<div><ul data-role="listview" data-theme="k" data-filter="true">';
var firstChar = '';
while ( i < numOfItems ){
// Get the current item. This will be a MessageValueCollection.
var currItem= items<i>;
// Get the properties of the current item.
var owner = currItem.getData("LeaveApprovalItem_owner_attribKey").getValue();
var type = currItem.getData("LeaveApprovalItem_itemType_attribKey").getValue();
var status = currItem.getData("LeaveApprovalItem_itemStatus_attribKey").getValue();
var startDate = currItem.getData("LeaveApprovalItem_startDate_attribKey").getValue();
var endDate = currItem.getData("LeaveApprovalItem_endDate_attribKey").getValue();
// Format the data in a specific presentation
var formatStartDate = Date.parse(startDate).toString('MMM/d/yyyy');
var formatEndDate = Date.parse(endDate).toString('MMM/d/yyyy');
// Decide which thumbnail image to use
var imageToUse = ''
if (status == 'Pending'){
imageToUse = 'pending.png';
else if (status == 'Rejected'){
imageToUse = 'rejected.png';
else {
imageToUse = 'approved.png';
// Add a new line to the listview for this item
htmlOutput += '<li><a id ="' + currItem.getKey() + '" class="listClick">';
htmlOutput += '<img src="./images/' + imageToUse + '" class="ui-li-thumb">';
htmlOutput += '<h3 class = "listTitle">' + type;
htmlOutput += ' ( ' + owner + ' ) ';
htmlOutput += '</h3>';
htmlOutput += '<p>' + formatStartDate + ' : ' + formatEndDate + '</p>';
htmlOutput += '</a></li>';
i++;
htmlOutput += '</ul></div>';
// Remove the old listview and add in the new one. Note: this is suboptimal and should be fixed if you want to use it in production.
$('#My_ApprovalsForm').children().eq(2).hide();
$('#My_ApprovalsForm').children().eq(1).after(htmlOutput);
// Add in a handler so that when a line is clicked on, it'll go to the right details screen
$(".listClick").click(function(){
currListDivID = $(this).parent().parent();
$(this).parent().parent().addClass("ui-btn-active");
navigateForward("Request_Details", this.id );
if (isBlackBerry()) {
return;
// All done.
return true; -
Best way to control and read data from multiple instruments?
Hello,
I'm building an application to test power supplies involving multiple pieces of equipment over a couple of different comm busses. The application will also send control instructions to some of the instruments, and read data from some of the instruments. The reading and control profiles will not run on the same schedule (variable length control steps, configurable read interval).
I was thinking of using a queued statemachine (producer/consumer) for the control profile and another to read the data, but I got concerned that there would be collisions between sending control commands and read commands to the same machine. Is there a suggested design pattern for implementing something like this?
Timing of the commands isn't critical down to the milisecond, but I need to collect reasonably accurate timestamps when the data is read. The same is true for the control commands.
Here are the instruments I'm going to use, if the are control, read, or both, and the communication method
Instrument Funtions Comm Method
Power Supply Read data Communicates to PMBus Adapter
PMBus to USB Adapter Read data USB (Non-Visa)
Switch control relays USB (VISA)
Power Dist. Unit read data/control outlets SNMP (Ethernet)
Electronic Load read data/control load GPIB (VISA)
Thermal Chamber read data/control temp Ethernet (VISA)
Thanks,
SimonHello, there is a template in LV called "Continuous measurement and Logging".
It can give you some idea how to properly decouple the "GUI Event handler" top loop (where your Event structure is) from the DAQ and other loops.
You do not need to totally replicate the above example, but you can find there nice tricks which can help you at certain points.
The second loop from the top is the "UI message loop". It handles the commands coming from the top loop, and regarding to the local state machine and other possible conditions and states, it can command the other loops below.
During normal run, the different instrument loops just do the data reading, but if you send a control command from the top loop to a certain instrument loop (use a separate Queue for every instrument loops), that loop will Dequeue the control command, execute it, and goes back to data reading mode (in data reading mode the loop Dequeu itself with a "data read" command automatically). In this way the control and data read modes happen in serial not in parallel which you want to avoid (but I think some instrument drivers can even handle parallel access, it will not happen in really parallel...).
In every instrument loop when you read a value, attach a TimeStamp to it, and send this timestamp/value couple to the DataLogging loop via a Queue. You can use a cluster including 3 items: Source(instrument)/timestamp/value. All the instrument loops can use the same "Data logging" Queue. In the Datalogging while loop, after Dequeue-ing, you can Unbundle the cluster and save the timestamp and data-value into the required channel (different channel for every instrument) of a TDMS file.
(Important: NEVER use 2 Event structures in the same top level "main" VI!) -
How to create and up date infostructure?
Hi,
Can any body tell us how to create and upload data to info structure?
regards,
N.NagarajuHi,
For maintenance of Infostructures the T-Code is LBWE.
There you can chage the structure by clicking on Structure Maintenance.
For creation of InfoSources the T-Code is RSA1.
Thanks,
Amit. -
How to create and read text file using LabVIEW 7.1 PDA module?
How to create and read text file using LabVIEW 7.1 PDA module? I can not create a text file and read it.
I attach my code here.
Attachments:
File_IO.vi 82 KBWell my acquisition code runs perfect. The problem is reading it. I can't seem to read my data no matter what I do. My data gets saved as a string using the array to string vi but I've read that the string to array vi (which I need to convert back to array to read my data) does not work on the pda. I'm using version 8.0. So I was trying to modify the program posted in this discussion so that it would save data from my DAQ. I did that but I still can't read the data after its saved. I really don't know what else to do. All I need to do is read the data on the pda itself. I can't understand why I'm having such a hard time doing that. I found a possible solution on another discussion that talks about parsing the strings because of the bug in the "string to array" vi. However, that lead me to another problem because for some reason, the array indicators or graphs don't function on the pda. When i build the program to the pda or emulator, the array indicators are faded out on the front panel as if the function is not valid. Does this kind of help give a better picture of what I'm trying to do. Simply read data back. Thanks.
-
Hello All...........,
I have done some code for applet and servlet communication in which i writes "String " as an object and gets reply from servlet as a string as follows:
// send data to the servlet
String input="hello there.....";
URLConnection con = getServletConnection();
OutputStream outstream = con.getOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(outstream);
oos.writeObject(input);
oos.flush();
oos.close();
// receive result from servlet
InputStream instr = con.getInputStream();
ObjectInputStream inputFromServlet = new ObjectInputStream(instr);
String result =(String) inputFromServlet.readObject();
outputField.setText(result);
//outputField.setText("good morning");
inputFromServlet.close();
instr.close();This code is same at servlet end.
But now i want to pass an int array.How to pass int[] as an object.
It is giving me error if i pass int array as int array[]={1,2,3}; oos.writeObject(array); Why is it so?
Can anybody tell me how to write and read int array[].
Thanks.
Shraddha.hello kaj,
I am trying to write as follows
while writting:
int array[]={1,2,3,4,5};
URLConnection con = getServletConnection();
OutputStream outstream = con.getOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(outstream);
oos.writeObject(array);
oos.flush();
oos.close();
while reading:
InputStream instr = con.getInputStream();
ObjectInputStream inputFromServlet = new ObjectInputStream(instr);
int result[] =(int []) inputFromServlet.readObject();
Thanks,
Really imp for me. -
How to get and read a file from META-INF directory
how to get and read a file from META-INF directory in a EJB project
Use this.getClass().getResourceAsStream("/META-INF/filename");This should work. Probably, you would need to set the Manifest Class-Path attribute.
-
How to make VI wait until data is saved before it can open and read data
I have developed two VIs for continuous monitoring. First VI is for acquiring raw strain data and saving it into a folder, let's say, every 10 minutes or every 100 Mbyte of data (for example, after monitoring for an hour, the folder will have 6 files, each of which contains 10 minutes of data). Second VI is for opening/reading/processing data files collected by the first VI. Right now, this second VI can handle only one file at a time. What I am trying to do is to have this second VI open the files one after another automatically. Also (here is what I think will be difficult part), I want the second VI recognize that a file is saved by the first VI before opening it (i.e., wait until the first 10 minutes of data file is saved by first VI, open and process this first data, wait until the second 10 minutes of data file is saved by first VI, open this second file and process it, wait until the third 10 minutes of data file is saved by first VI, open and process it........). Any help or comments would be appreciated.
Thanks in advance for your help.
Brdg.Basically, If your purpose is to keep one thread from opening the file until the DAQ thread has finished with it, then the queue is what I would use.
All functions are on the ADVANCED | SYNCHRONIZATION | QUEUE palette.
Use the OBTAIN QUEUE to create the queue. Set the DATA TYPE to a PATH constant. This creates a queue of paths.
Pass the QUEUE REFNUM to both the DAQ VI, and the PROCESSING vi.
In the DAQ VI, when you write a file, take the PATH from the CLOSE FILE function and use ENQUEUE ELEMENT to put it into the queue (use the refnum you passed in).
In the processing thread, use DEQUEUE ELEMENT to fetch the path from the queue. You probably should use a timeout value of 1000 mSec or so. If you timed out, go check your PROGRAM RUNNING flag (so you can stop without waiting forever on the queue), and if you're not stopped, try again.
If the DEQUEUE ELEMENT returns WITHOUT a timeout, then open the path it gives you - the file is guaranteed to be closed, since you closed it before you enqueued it.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com
Blog for (mostly LabVIEW) programmers: Tips And Tricks -
I've attached a VI that I am using to acquire amplitude from Spectrum analyzerse. I tried to connect amplitude ouput to the VI Write Characters To File.vi and Write to Spreadsheet File.vi. Unfortunately when I run continual this VI without interruption, labview ask me many time to enter a new file name to save a new value.
So, How can I do to aquire and save date in the same time and in the same file when I run continual my VI for example during 10 min.
Thank you in advance.
Regards,
Attachments:
HP8563E_Query_Amplitude.vi 37 KBHi,
Your VI does work perfectly. Unfortunately this not what I want to do. I've made error in my last comment. I am so sorry for this.
So I explain to you again what I want to do exactly. I want to acquire amplitude along road by my vehicle. I want to use wheel signal coming from vehicle to measure distance along road. Then I acquire 1 amplitude each 60 inches from spectrum analyzer.
I acquire from PC parallel port a coded wheel signal coming from vehicle (each period of the signal corresponds to 12 Inches). Figure attached shows the numeric signal coming from vehicle, and the corresponding values “120” and “88” that I can read from In Port vi.
So I want to acquire 1 time amplitude from spectrum analyser each 5
period of the signal that I am acquiring from parallel port.
So fist I have to find how can I count the number of period from reading the values “120” and “88” that I am acquiring from In Port (I don’t know the way to count a number of period from reading values “120” and “88”).
Here is a new algorithm.
1) i=0 (counter: number of period)
2) I read value from In Port
3) If I acquire a period
i= i+1 (another period)
4) If i is multiple of 5 (If I read 5 period)
acquire 1 time amplitude and write to the same
file this amplitude and the corresponding distance
Distance = 12*i). Remember each period of signal
Corresponds to 12 Inches).i has to take these
values: 5,10,15,20,25,35,40,45,50,55,60............
5) Back to 2 if not stop.
Thank you very much for helping me.
Regards,
Attachments:
Acquire_Amplitude_00.vi 59 KB
Figure_Algorithm.doc 26 KB -
How to loop and read repeating table data of infoPath form in Visual studio workflow.
Hi,
I am trying to read info Path form repeating table data in Visual studio workflow.
could anyone elaborate me in brief how to loop through repeating table and read all rows value one by one in workflow.
any help would be more then welcome.
Thanks...Hi Rohan,
According to your description, my understanding is that you want to create a Visual Studio workflow to get data from info path repeating table.
I suggest you can submit Repeating Table to a SharePoint List and then you can create a .NET workflow to read data from the SharePoint List.
Here are some detailed articles for your reference:
Codeless submitting InfoPath repeating table to a SharePoint list
Create a Workflow using Visual Studio 2010
Best Regards
Zhengyu Guo
TechNet Community Support
Maybe you are looking for
-
An issue with multiple checkboxes displaying correctly.
My company is converting our website to seam. We obviously have a number of existing pages we must convert and at least try to mimic the previous code. The page I'm currently working on is a catalog request form(see: http://www.perma-bound.com/Catalo
-
dowloaded the ios6 on my ipad2...and would like to use Siri...how do I proceed
-
Conversion failed when converting the varchar value to data type int
Hi, I am unable to resolve this error and would like some assistance please. The below query produces the following error message - Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value 'NCPR' to data type int. Select
-
About Retail & Modules Related to Retail
Hi Experts, I am new to Retails, I need information regarding Modules involved in Retail & Landscape ( Compatibility with BI Analytics ) . Thanks, Swap
-
I've been using Lightroom for many years. My machine is an iMac, plenty fast and lots of RAM. I went to change the song that was already in Lightroom for a slideshow and once I selected the song, Lightroom quits and an error comes up. Do I need to re