08-14-2012 11:45 PM
Hi,
this is my first program in labview.
I want to use a while loop to continuously input data to the DAQ , which displays it to an oscilloscope. The signal out should be controlled by a switch (0 when switch is open and 1 when switch is pressed).
I placed a toggle switch in the while loop, and connected the output to the DAQ manager, but it is showing a connection error.
Type of source is boolean.
Type of sink is 64 bit real.
So how should I convert data from the switch so that it gets fed into the DAQ output?
Thanks.
Solved! Go to Solution.
08-15-2012 12:22 AM
Its tough to imagine how you might have coded can you please post the code you have made then its easy (Post in 2009 version . File>>Save for previous version>>Select 2009 and save)
08-15-2012 12:30 AM
What happens to the signal when the switch is off?
Go to zero? Go to some other value? Remain at last "on" value?
08-15-2012 01:26 AM
Sorry, here is my code.
I think I need to either convert the individual pulses to an array, or change the chart type so that it takes in data continuously.
08-15-2012 01:27 AM
When switch is off, it sends a zero, when it is on, it sends a 1.
08-15-2012 01:46 AM
Hi,
Your example code seems to need a build array function to get array of boolean. Could you check it?
Br,
Peter
08-15-2012 01:50 AM
By the way,
Do you know that, the boolean value outside of the loop will get value after pressing the stop button(once)?
If you vant to change it in every iteration, you should put it inside the loop.
Br,
Peter
08-15-2012 09:22 AM - edited 08-15-2012 09:25 AM
@Soham_S wrote:
When switch is off, it sends a zero, when it is on, it sends a 1.
Then you have to keep DAQmx inside the while loop probably you can use event structure to do this. Also while you configure the Digital output you should select single channel instead of multiple (unless you really have multiple channels) then you will be able to wire the switch directly to it.
08-15-2012 11:23 PM
Here's the updated code.
Here, in the chart indicator, the time value keeps increasing, and I cannot see the data of the entire run at once. What can I do so that I can see all the 1s and 0s in the graph, along with the time, after the program is stopped.
Also, now the DAQ setting is set into 1 sample on demand. So if I export the data to a measurement file, the array is not continuous.
If I set it to continuous samples, the connection diagram shows an error. What can I do so that I can store the data in a file, so that it can be read by the chart later?
I am attaching my code below.
08-16-2012 12:12 AM
Please post in 2009 version.