MeltingPlastic Posted November 30, 2007 Report Share Posted November 30, 2007 Hello there, I'm new to labview and am using the Copact RIO 9012 as well as the 9205 analog input. Attached is the code i'm currently using. I'm trying to take 2 analog inputs from AI0 and AI1 and send them over DMA to my host PC. Once on the host pc, i want to display it on a waveform chart as well as write the data to an excel file when i flip the boolean switch. As of now i have gotten the system working perfectly with just 1 channel.. AI0. WHen i attempt to add the 2nd channel things don't work out that well. I've followed the turtorial shown here: http://zone.ni.com/devzone/cda/tut/p/id/4534 I have my inputs hooked up to a 7.6V battery and a 20k pot to vary the inputs to confirm my input channels are working. If i hook up only 1 channel it displays that signal as one channel. When i hook up both channels thats when things get weird and don't act the way they should. What am i don' wrong here? I'm using labview 8.0 and plan on upgrading to 8.2 tonight if that will help me but i highly doubt that. Attached is my labview code i am using for the FPGA and the host as well as the output graph i was telling you about. I have only been programming with labview for about 2 weeks and am completely new so there might be something simple i'm overlooking but i'm currently stumped. Thanks guys.. Mike Quote Link to comment
ned Posted November 30, 2007 Report Share Posted November 30, 2007 QUOTE(MeltingPlastic @ Nov 29 2007, 03:18 PM) I have my inputs hooked up to a 7.6V battery and a 20k pot to vary the inputs to confirm my input channels are working. If i hook up only 1 channel it displays that signal as one channel. When i hook up both channels thats when things get weird and don't act the way they should. What am i don' wrong here? I'm using labview 8.0 and plan on upgrading to 8.2 tonight if that will help me but i highly doubt that. This is just a guess, but try right-clicking on your graph and uncheck "Transpose Array." See if that fixes your problem. Quote Link to comment
MeltingPlastic Posted December 1, 2007 Author Report Share Posted December 1, 2007 QUOTE(ned @ Nov 29 2007, 05:08 PM) This is just a guess, but try right-clicking on your graph and uncheck "Transpose Array." See if that fixes your problem. Thanks ned, What i've realized the graph is doing is outputing the difference between the two signals instead of displaying two different plots for some reason. I can't seem to get the graph to not do that. any help would be great Quote Link to comment
ned Posted December 1, 2007 Report Share Posted December 1, 2007 QUOTE(MeltingPlastic @ Nov 29 2007, 11:47 PM) Thanks ned,What i've realized the graph is doing is outputing the difference between the two signals instead of displaying two different plots for some reason. I can't seem to get the graph to not do that. any help would be great Right - which is why I suggested unchecking "Transpose Array." A chart can take a lot of different types of data as input. One data type is a two-dimensional array, where one axis is points in time, and the other is plots. You can add multiple points to a chart at the same time. What's happening here is that your axis are being interpreted backwards. Each time through your loop, instead of adding one point to each of two plots, you're adding two points to the same plot. Then it draws a line between them, which is what you're seeing. Try replacing your combination of decimate array and build array with the following (index array and bundle), so that you're passing a cluster to the chart: http://lavag.org/old_files/monthly_11_2007/post-3989-1196441775.gif' target="_blank"> Quote Link to comment
Dean Mills Posted December 1, 2007 Report Share Posted December 1, 2007 Hi My recommendation would be to look in the NI example folder. There are a few examples on doing Basic IO there with a cRIO. You need to look under Toolkits and Modules=>FPGA=>CompanctRIO=>Basic IO=>Analog Input - cRIO.lvproj On my computer it is here C:\Program Files\National Instruments\LabVIEW 8.2\examples\CompactRIO\Basic IO\Analog Input\Analog Input - cRIO.lvproj Replace the LabVIEW 8.2 with your version. This is the best way to learn. This example also contains code to allow for converting the binary value to voltage. Binary 0 does not equal 0 volts. Dean Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.