How to temporally match/save Input and Output Channels's data?
Hello, I have a voltage-input, voltage-output SISO system, and need to indentify its dynamic response (or transfer function) as a reference to a PID control. Without using the system identification toolbox, my goal is to generate/provide a sine sweep input (ranging 1Hz-5kHz for 10sec) to the system and to save the corresponding output response signal as well as the sweep input signal simultaneously.
I got a sample program online and am trying to modify it as attached, but I really need your advices/comments concerning several problems I am facing with:
1) With the below setting, the number of the acquired Input channel samples obtained is 5461, which is smaller than expected (i.e., 10000). What would I be missing in setting parameters?
- H/W: NI-USB-6341 DAQ
- AO: continuous samples with the waveform timing (1k sampling, 10000 samples => 10 sec, slower sampling just for testing purpose)
- AI: continuous samples, samples to read: 30k, rate: 1k
2) I am using flat sequence structure as a way to making the start point of saving AI and AO data same, but wonders if this is a right method or if there is other better approaches. (I had an idea of using an internal clock with "1-sample mode" for sync, but this may not work at the high speed sine sweep like 5kHz, right?)
3) I just want to provide the sine sweep just once to the system and do not require the "reset" functionality implemented in the original sample program. I failed to remove this "reset" part as I did not fully understand the sample code. If I run the attahed, the generated AO signal is periodically provided to the system. Please give me any advice to modify the program as I want.
Thanks for your help and valualble time.
Attachments:
siso.vi 230 KB
Hi J. Kim,
To begin, you say you want to synchronize your analog input and output so that they start at the exact same time, yes? To achieve tight synchronization, you need to use DAQmx VIs instead of the DAQ Assistant. There's a good overview of DAQmx VIs here. There's also a document that deals specifically with synchronization in DAQmx here. Additionally, if you go to Help>>Find Examples in the LabVIEW example finder, you can see many other examples of acquiring data using DAQmx.
As for your configuration, you have your analog input DAQ assistant wired far before your analog output DAQ assistant in your sequence strucutre, so the dataflow of the program will cause the analog input DAQ Assistant to execute before the output. They cannot be in different sequences if they are executing simoultaneously, and I would not use flat sequences here except to start the two tasks in DAQmx. Where did you find this example?
Best,
Dan N
Applications Engineer
National Instruments
Similar Messages
-
CFP-AIO-610 electrical isolation between input and output channels
Manual states "The input and output channels of the [c]FP-AIO-610 are not electrically isolated from each other". I assume this means that the commons on the input channels are connected and the commons for the output channels are connected but it does not mean that all channels on the module are connected. Is this correct? I intend to monitor two self-powered 4-20mA signals coming from a single instrument and also send two voltage signals to a different instrument. Any advice is greatly appreciated. Thanks!
RavensFan wrote:
Why do you think there aren't situations where common AI and AO references are acceptable? I think in most situations where it is already okay to use non-isolated channels, having common commons is just fine.
From the standpoint of interacting with two different instruments, such as my situation. Rarely in my experiences so far are analog communication or measurements on separate instruments going to all be referenced to the same common / earth ground. Instrument A has it's own common reference and instrument B has it's own common reference. My 20mA loop is externally powered and I can earth ground the power supply negative but the voltage output to another instrument is not but hte channels are isolated so maybe I can do it anyway. I'm hardly an expert and only trying to build my own knowledge base on how to use NI hardware. Perhaps I'm over-thinking this too much and it will work. -
How to save input and output in file
hi ni
i have program that has some input and some output
i try to save the input and output in file word office or excel like this
error
extended
ideal
value
wq
wp
value
xq
xp
0.857143
0.7
0.6
2
0.5
1
1
thank in advace
best regards
m.s
lab view 2011
hi ?Q>
Solved!
Go to Solution.
Attachments:
adder in exteded stochastic.vi 37 KBjohnsold wrote:
Read from and Write to Spreadsheet File VIs should do what you want.
I did not take the time to try to decipher what your program is doing, but I think you could replace all those feedback nodes and Build Arrays with an integer data type and the Rotate function from the Numeric >> Data Manipulation palette. You will still need one shift regsiter or rfeedback node for each of the four signals.
You have duplicated code: Divide by 65535, multiply by 2, and subtact 1 followed by a > comparison. Make that a subVI and place 4 instances on your block diagram.
Those simple changes will make you diagram understandable, reduce its size to the size of a postcard, and make any future changes easier.
Lynn
thank
hi ?Q> -
How to remove items from INPUT and OUTPUT?
I installed a Movavi demo and deleted (uninstalled) it, but the Movavi sound Grabber still exists in my INPUT and OUTPUT section under sound options. It's making the sound screwy and I often lose audio when I switch from headphones, to blue tooth speaker. Please help!
You have not uninstalled it correctly, check the directions and do so.
-
How to continously recorded the iput and output wave
I used NI-FGEN and NI-Scope in Bender element test a.I want to know how to continously recorded the input and output wave. Thanks you so much
I did a bit more looking and found out that I was wrong. My apologies. NI-HWS is currently shipping with the high-speed digital products and the waveform editors (analog and digital). It is not shipping with NI-FGEN or NI-SCOPE. sfpFile shipped with NI-SCOPE 2.1.2 through 2.5 and NI-FGEN 1.5. NI-HWS was not finished in time for the latest NI-SCOPE and NI-FGEN releases. For now, you will need to use sfpFile. Copy the examples to make your life much easier. Your application is simple enough that the basic functions should work for you. Don't worry about losing your data, since sfpFile and NI-HWS use the same format. In any case, it is all based on HDF5, and you can get HDF5 utilities (free for any use) from the NCSA website. A word of warning - HDF5 is VERY powerful, but also VERY difficult to use. sfpFile and NI-HWS are based on the 1.4.4 release of HDF5. The current 1.6.x release of HDF5 is file format compatible, but binary incompatible with the 1.4.x release. NCSA did not change the format of the files they are writing, but did change the code that writes to them.
This account is no longer active. Contact ShadesOfGray for current posts and information. -
I'm trying to record in Audition and it keeps saying my sample rates for the input and output devices don't match. How do I fix this?
I finally have communication between the ISA One and Audition. I moved the optic cable to another SPDIF on the computer and from the SPDIF to ADAT on the ISA One and it finally agreed that the communication was at the same clock speed. The audio was not intelligible so I moved the optic cable back to the original configuration and I can record voice that is clean.
-
How can I use a different driver for audio input and output?
I did a search of course, and came up with something about an aggregate. I have no idea what this is, how to do it, or if it would even work for me.
What I am trying to do is:
1) Record into Logic Express using my Tascam US-122.
2) Have playback come out of my computer sound system, not the Tascam.
If I go over to the Audio setup window, I can only record when the driver is set to Tascam US-122. Likewise, I can only listen to sound when my Built-In Audio is selected. It gets rather annoying going between the two.
So, would this aggregate thing solve my problem? If so, how do I do it? Thanks for any help!
-allenYes it should do what you want.
Go to "Audio Midi Setup", and go to the Audio menu and click "Open Aggregate Device Editor". The interface is pretty simple but if you do get stuck, just use the help function in Audio Midi Setup, as it has a step by step guide.
Then when you return to logic, go to the Preferences>Audio>Drivers section and select Aggregate Device as the new driver rather than either the built in sound or the tascam. Then the inputs and outputs will apply to BOTH devices. -
SSIS: How to use one Variable as Input and Output Parameter in an Execute SQL Task
Hello,
i need your help,I'm working on this issue since yesterday and have no idea how to deal with it.
As I already said in the tilte i want to start a stored procedure via a Execute SQL Task which has around 15 prameters. 10 of these should be used as input AND output value.
As an example:
i have three Variable:
var1 int 2
var2 int 100
var3 int 200
the stroed procedure:
sp_test
@var1 int
@var2 int output
@var3 int output
AS
BEGIN
SET @var2 = @var2 * @var1
SET @var3 = @var3 + @var1
END
So in the Execute SQL Task i call the Stored Procedure as follwos:
Exec sp_test @var1 = ?, @var2 = ? output, @var3 = ? output
(I use an OLE DB Connection)
The parameter mapping is as follows:
User::Var1 input numeric 0 -1
User::Var2 input/output numeric 1 -1
User::Var3 input/output numeric 2 -1
Now my problem. If i set Var2 and Var3 as Input parameter the values are still the same after running the package. If i set them to a output value the are both Null because the procedure doesnt get any values.
I already tried to list them a second time - like
User::Var2 input numeric 1 -1
User::Var2 output numeric 1 -1
or i use a new variable
User::Var2 input numeric 1 -1
User::Var2Return output numeric 1 -1
but i alwas get the error
"Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done."
Has anybody an idea how I can solve this problem?
Thanks a lot.
Kind Regards,
AliceHi Alain,
thx for your answer.
I have around 15 procedures called one after the other to calculated and modify my values. Each procedure is responsible for an other but overlapping set of variables. So i thought it would be a good idea to call them one after the other with the needed variables via a execute sql task.
So if i use a result set, how i get my stored procedure to return 10 values? I would have to use a Function instead of a procedure, wouldn't i?
As if i have 15 procedures this would be a lot of work.
But thanks a lot for the idea. I think an other idea would be to create one function which calls all stored procedures and returns all the calculated values as a result set, wouldn't it?.
Kind Regards.
Alice -
How to use a bluetooth cellphone for audio input and output
Hello, I was wondering how to set-up my Mac Book so that I can use my bluetooth cellphone for audio in and audio out. Ideally, I would like to use my handset for talking on iChat and Skype. Has anyone had any luck doing this? When I bond my cellphone these optiosn do not appear. I know that this is easy to do on a Windows machine but I am not sure about how to do it on my Mac Book.
Thanks!Yes it should do what you want.
Go to "Audio Midi Setup", and go to the Audio menu and click "Open Aggregate Device Editor". The interface is pretty simple but if you do get stuck, just use the help function in Audio Midi Setup, as it has a step by step guide.
Then when you return to logic, go to the Preferences>Audio>Drivers section and select Aggregate Device as the new driver rather than either the built in sound or the tascam. Then the inputs and outputs will apply to BOTH devices. -
How do I create an xControl with multiple inputs and outputs?
Hello,
i am trying to write a new Xcontrol Element. In the data model I can create data types using the cluster to create compound types, eg an int and an int array. But how do I create an xcontrol which has multiple data inputs and outputs?
Kind RegardsLimping_Twerp wrote:
Alright: I see: An xcontrol is either an input OR an output. How do I achieve an output? Secondly: So you are saying the only Elements that can have multiple inputs and outputs are VIs?
Can you take a few steps back and explain what you are actually trying to do. SubVIs and Xcontrols have nothing in common and it is not clear why you even try to compare them side by side (e.g. in terms of the number of connectors).
Your questions about input or output tell us that you seems to have some misconceptions about xcontrols. Xcontrols are like regular controls, except they have some built-in intelligence that you can program. Most front panel object can be either controls or indicators and the same is true for Xcontrol. You create an Xcontrol, and after placing it on the front panel you can decide if it should be a control (where the code reads the value) or an indicator (were the code writes values to it). When you define the xcontrol facade, you also need to program how the visuals change if it is changed from control to indicator or vice versa.
As a first step, you should opend the example finder and look at some xcontrol examples.
Again, what are you actually trying to do?
LabVIEW Champion . Do more with less code and in less time . -
How to get input and output using math interface toolkit
Hi,
I am fairly new to labview and i am trying to convert my labview code
into matlab mex files using math interface toolkit. I cant see any
input or output terminals when i try to convert the code to mex files
even though my vi has plenty of inputs and outputs that should be
available during conversion.
just to cross check i made another vi in which i inputted an
array of data to an fft and outputted it to an array again. i tried to
convert this code to mex files but was still not able to see any input
or output terminals, which makes me believe that i must be doing
something wrong at the very basic level and inspite of trying really
hard for some days now i have not been able to figure out that might be.
So please help.
I am attaching the basic vi that i created along with the link that i followed for converting labview code to mex files.
http://zone.ni.com/devzone/conceptd.nsf/webmain/EEFA8F98491D04C586256E490002F100
I am using labview 7.1
Thanks
Attachments:
test.vi 17 KBYes, you've made a very basic mistake. You have front panel controls and indicators but none of them are connected to the VI's connector pane. right click on the VI's icon and select "Show Connector". You use the wiring tool to select a connection there and then select a control or indicator. Use the on-line help and look up the topic "connector panes". There are some sub-topics on how to assign, confirm, delete, etc.
-
How to change the input and output schema in BPEL process
hi',
Please tell me how to change the input and output schema in BPEL process after the process is made.
thanks
YatanIf your intention is just changing the content you are passing to bpel/returning from bpel
Here is another way
just update your default created xsd files with new elements, update wsdl elements in message definition and chnage bpel code to reflect new elements in activities
Regards,
Praveen -
How to control (the input and output) EXE file after I call it using exec?
Hi,
I knew that I can use runtime.exec() to call one EXE file, and this works. But this EXE has two characteristics:
1. After this exe starts, it asks user to input number such as 1 or 2 onto computer screen, then press return. Then the exe will start the calculation.
2. after it starts calculation, it prints 3 columns of numbers onto the screen.
My two questions are:
1. How to use java to input the number such as 1 or 2 automatically? this EXE can not work like this in DOS command line:
C:> file.exe parameter
The parameter is the number such as 1 or 2 that I wanna input.
2. how to redirect the 3 columns of numbers from computer screen to txt file?
My colleague can solve these two questions using Mathematica. So I know that definitely there is at least one solution for it. I just can not do it using Java. This wierd exe file bothered me a lot and I really wish that I can get help from someone in java community.
Thank you!
TonyWhen you call Runtime.exec, you get a Process object. (I presume something similar happens when you use ProcessBuilder.) Process has methods with names getOutput, getInput, and getError. These correspond to the standard input, standard output, and standard error streams of the spawned process.
You can read and write to the process on the streams corresponding to input and output that the process writes to the console.
[add]
In fact, you should be grabbing and reading the output/error streams anyway, because of the points raised by the Traps article. Google "Java Runtime exec traps" and you'll probably get a link to this JavaWorld article, which describes common Runtime.exec problems and how to solve them.
Edited by: paulcw on Jun 15, 2010 4:09 PM -
How to get the sine wave sample of the input and output in the same time?
I discovered that the samples were acquired did not in the same time in my vi.Could you tell me how to get the sine wave sample of the input and output in the same time?
Output:9263;
Input:9201
Attachments:
singal requency.vi 104 KBHello Yun_Zhu,
Your VI looks like you started from an example, and you are on the right track.
To clarify are you trying to synchronize the input and the output waveforms? If you you will need to share a time base and a start trigger. Check out the synchronization examples from LabVIEW
Anthony F.
Product Marketing Engineer
National Instruments
Attachments:
HIODAQmxSyncMultiDev.png 70 KB -
How to set the input and output of a subVI
I am trying to configure a subVI by following Chap. 7 of "LabVIEW fundamentals". But I stuck at "Building the connector pane".
My subvi is quite simple, just for testing purpose. I plan to do a summation and display the result. So I placed one numeric Add icon on the block diagram and a numeric Indicator on the front panel. I built a connector pane with three terminals, two for input and one for output.
But, how could I associate the terminals on connector pane with inputs and outputs of terminals on the block diagram? I wanna build a subVI, whose input are two numbers and display the summation on the subVI.
Forrest Sheng Bao, Ph.D.
Assistant Professor, Dept. of Electrical & Computer Engineering
University of Akron, Akron, OH, USA
https://sites.google.com/site/forrestbao/Hi Forrest Bao,
use the right mouse key as often as you can in LabVIEW. It´s very helpful. If you right click on a link in the connector pane, then you can select to disconnect selected or all.
Mike
Message Edited by MikeS81 on 08-28-2008 01:33 PM
Maybe you are looking for
-
What years apple cinema display can I connect to the new 2012 mac mini?
I have a 23" Apple Cinema Display that I purchased in 2007. I currently have it connected to m7 2009 Mac Mini. Can I use it with the new 2012 Mac Mini? I am running the latest OS on my 2009 Mac Mini. I want to upgrade my Mac Mini for more storage a
-
Does anyone know how the internal DHCP server in these access points connects to virtual interfaces and bridges in the unit? Is there some sort of default connection that connects the DHCP server to the native bridge group or VLAN? In a test case, wi
-
HT201250 Using Time Machine as an external hard drive
I backed up my iMac with an external hard drive using Time Machine; can I delete all the data from my iMac now? My real goal is to use the 1TB external hard drive I just got to store all my music, photos, and other files on. I want to clear all the s
-
The previous Photo Library allowed you to drag and drop your photo from the Photo Software straight into Word 2011. 'Photos' doesn't seem to allow me to do this. And then when I go into word and try to insert a photo into the document the proper (lon
-
Why 2 castings in return statement of entrySet() of HashMap?
Hi When looking through the code of the HashMap class in jdk 1.5 in Eclipse 3.2 I see the following: public Set<Map.Entry<K,V>> entrySet() { Set<Map.Entry<K,V>> es = entrySet; return (es != null ? es : (entrySet = (Set<Map.Entry<K,V>>) (Set) new Entr