LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

vi or idea for continous AI and user-evoked AO

Hi! I am looking a (simple) vi or 'idea' how to write it for system where
one
analog channel is read continously (and PSD estimated) and where user
can give short predefined analog output waveforms. User have to have
ability to choose one of 5-8 output waveforms and write it one of two
output channels. I have E-series card.

All ideas welcome, thanks, Tapio G.
0 Kudos
Message 1 of 7
(3,112 Views)
This sounds easy enough. The analog input should not be affected by an
analog output. Allow the user to either create a waveform or select a
predefined waveform. This could be an array of points, or points
generated by other VIs. Using the Analog Output VIs, you can output an
array of points on the DAC (only one; you can't have two different
waveforms on 2 different DACs at the same time without significant
effort) at a specified rate, and there you go.

Mark

In article <39a270fd@newsgroups.ni.com>,
"Tapio Grönfors" wrote:
>
> Hi! I am looking a (simple) vi or 'idea' how to write it for system
where
> one
> analog channel is read continously (and PSD estimated) and where user
> can give short predefined analog output waveforms.
User have to have
> ability to choose one of 5-8 output waveforms and write it one of two
> output channels. I have E-series card.
>
> All ideas welcome, thanks, Tapio G.
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.
0 Kudos
Message 2 of 7
(3,111 Views)
Many thanks, but this is not piece of cake for me :-< I have tried modify
several examples from LV own base, and seamless speed AI with plotting and
PSD est. is easy, as well as speedy AO with user selectable waveforms and
launching, but putting them both together crashes. If somebody still want
look my sketch:
http://bscw.uku.fi/pub/english.cgi/d221967/LVstimu2r2_70.jpg

mark.wysong@ae.ge.com wrote:
>This sounds easy enough. The analog input should not be affected by an>analog
output. Allow the user to either create a waveform or select a>predefined
waveform. This could be an array of points, or points>generated by other
VIs. Using the Analog Output VIs, you can output an>array of points on the
DAC (only one; you can't have two different>waveforms on
2 different DACs
at the same time without significant>effort) at a specified rate, and there
you go.>>Mark>>In article <39a270fd@newsgroups.ni.com>,> "Tapio Grönfors"
wrote:>>>> Hi! I am looking a (simple) vi or 'idea'
how to write it for system>where>> one>> analog channel is read continously
(and PSD estimated) and where user>> can give short predefined analog output
waveforms. User have to have>> ability to choose one of 5-8 output waveforms
and write it one of two>> output channels. I have E-series card.>>>> All
ideas welcome, thanks, Tapio G.>>>>>>>Sent via Deja.com http://www.deja.com/>Before
you buy.
0 Kudos
Message 3 of 7
(3,111 Views)
I'll check it out. In the meantime, if you would like, send it to me in
email, and I can write comments on it.

Mark

In article <39a348a5@newsgroups.ni.com>,
"Tapio Grönfors" wrote:
>
> Many thanks, but this is not piece of cake for me :-< I have tried
modify
> several examples from LV own base, and seamless speed AI with plotting
and
> PSD est. is easy, as well as speedy AO with user selectable waveforms
and
> launching, but putting them both together crashes. If somebody still
want
> look my sketch:
> http://bscw.uku.fi/pub/english.cgi/d221967/LVstimu2r2_70.jpg
>
> mark.wysong@ae.ge.com wrote:
> >This sounds easy enough. The analog input should not be affected by
an>analog
> output. Allow the user to either c
reate a waveform or select
a>predefined
> waveform. This could be an array of points, or points>generated by
other
> VIs. Using the Analog Output VIs, you can output an>array of points
on the
> DAC (only one; you can't have two different>waveforms on 2 different
DACs
> at the same time without significant>effort) at a specified rate, and
there
> you go.>>Mark>>In article <39a270fd@newsgroups.ni.com>,> "Tapio
Grönfors"
> wrote:>>>> Hi! I am looking a (simple) vi or
'idea'
> how to write it for system>where>> one>> analog channel is read
continously
> (and PSD estimated) and where user>> can give short predefined analog
output
> waveforms. User have to have>> ability to choose one of 5-8 output
waveforms
> and write it one of two>> output channels. I have E-series card.>>>>
All
> ideas welcome, thanks, Tapio G.>>>>>>>Sent via Deja.com
http://www.deja.com/>Before
> you buy.
>


Sent via Deja.com http://www.deja.com/
Before you buy.
0 Kudos
Message 4 of 7
(3,111 Views)
I looked at your diagram. I'm not sure what problem you are having, but
keep in mind that you don't have to have both functions happening in the
same while loop. I would recommend that you don't do it that way. With
two loops, your acquisition can run in its loop regardless of what the
user does. The way it is drawn now, if you are using buffered
acquisition, then any holdup in the analog output can cause your AI read
to wait, and thus your analog input buffer fills up, and an error
occurs.

Make another while loop with the analog output VIs in it. You can use
the same variable to end this loop as the last one. Therefore, your
analog input and analog output loops are independent of each other,
except for their loop termination logic.

Independence of loops is sometimes important. In this case, it makes
sense for your analog input to run regardless of anything else
happening.

Hope that helps.

Mark

In article <39a348a5@newsgroups.ni.com>,
"Tapio Gr�nfors" wrote:
>
> Many thanks, but this is not piece of cake for me :-< I have tried
modify
> several examples from LV own base, and seamless speed AI with plotting
and
> PSD est. is easy, as well as speedy AO with user selectable waveforms
and
> launching, but putting them both together crashes. If somebody still
want
> look my sketch:
> http://bscw.uku.fi/pub/english.cgi/d221967/LVstimu2r2_70.jpg
>
> mark.wysong@ae.ge.com wrote:
> >This sounds easy enough. The analog input should not be affected by
an>analog
> output. Allow the user to either create a waveform or select
a>predefined
> waveform. This could be an array of points, or points>generated by
other
> VIs. Using the Analog Output VIs, you can output an>array of points
on the
> DAC (only one; you can't have two different>waveforms on 2 different
DACs
> at the same time without significant>effort) at a specified rate, and
there
> you go.>>Mark>>In article <39a270fd@newsgroups.ni.com>,> "Tapio
Gr�nfors"
> wrote:>>>> Hi! I am looking a (simple) vi or
'idea'
> how to write it for system>where>> one>> analog channel is read
continously
> (and PSD estimated) and where user>> can give short predefined analog
output
> waveforms. User have to have>> ability to choose one of 5-8 output
waveforms
> and write it one of two>> output channels. I have E-series card.>>>>
All
> ideas welcome, thanks, Tapio G.>>>>>>>Sent via Deja.com
http://www.deja.com/>Before
> you buy.
>


Sent via Deja.com http://www.deja.com/
Before you buy.
0 Kudos
Message 5 of 7
(3,111 Views)
I thought I saw someone suggest to you that you should use 2 while loops,
not one? In this sketch you're still using only one while loop- so in the
worst case scenario your program will read one datapoint and then hang until
the user selects an output waveform, then read another datapoint and again
hang.

You need to split it into 2 while loops; the top three blocks on your
diagram being in the first, and the bottom three being in the second. The
loops will be executing simultaneously, so the top will run all the time
taking data and the bottom will run only when the user selects a waveform to
output.

I note you also specify that the loop is to be pauseless- baaad idea. I
think it's safe to say that every while loop that has something wired to its
conditional should have a pause. Otherwise the loop can pull down system
performance in general, and make Labview difficult to use while that vi is
running. A 10ms pause or even 100ms makes little difference to perceived
program speed, but makes a lot of difference to the CPU power available to
other applications, and available to other threads in Labview to, for
example, check if you're pressed the "abort" button.

You may be running it pauseless so you take data as often as possible- if
you're taking a reasonable amount of data over a long period you shouldn't
be taking a datapoint at a time. You can allocate a buffer to the DAQ card
and tell it how often to make a reading- it then goes away and takes those
readings, forever if need be, and you simply run a VI every so often that
retrieves an array of all the datapoints taken since you last emptied the
"queue". I don't really see any real DAQ applications where you'd want to
manually read a datapoint every time your program gets to a specific
function call unless you have no other choice; this approach limits your
timing resolution considerably, since the time between successive points
depends on the whims of Labview and the system at large and is unlikely to
be constant. If the datapoints are seconds apart then the error as a
percentage will be slight, but I don't get the impression this is what
you're aiming for.


Tapio Gr�nfors wrote in message
news:39a348a5@newsgroups.ni.com...
>
> Many thanks, but this is not piece of cake for me :-< I have tried modify
> several examples from LV own base, and seamless speed AI with plotting and
> PSD est. is easy, as well as speedy AO with user selectable waveforms and
> launching, but putting them both together crashes. If somebody still want
> look my sketch:
> http://bscw.uku.fi/pub/english.cgi/d221967/LVstimu2r2_70.jpg
0 Kudos
Message 6 of 7
(3,110 Views)
In article <39a270fd@newsgroups.ni.com>,
"Tapio Grönfors" wrote:
>
> Hi! I am looking a (simple) vi or 'idea' how to write it for system
where
> one
> analog channel is read continously (and PSD estimated) and where user
> can give short predefined analog output waveforms. User have to have
> ability to choose one of 5-8 output waveforms and write it one of two
> output channels. I have E-series card.
>
> All ideas welcome, thanks, Tapio G.
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.
0 Kudos
Message 7 of 7
(3,110 Views)