Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

data aquisition using 9237

I need to aquire strain using the 9237 with our CRio.  I'm setting up a scan mode program in Labview.  All of the examples I have found are pretty complex, and for this I need utter simplicity.  If setting up the program manually instead of using the DAQ assistant, I would like to know:

 

Is this as simple as setting up a new project with a host VI, and then in the project manager dragging that data channel of strain into the host VI diagram?  Does anyone know of any very basic program examples such as this?  We're turing the strain in to Newtons.   Would it be easiest to just do the manual calculations in Labview?  Or are there new options with the CRio and Labview 8.6.1 that do this kind of calculation for you?

0 Kudos
Message 1 of 8
(4,657 Views)

Ok, I am about to go insane testing this thing out.  Here is what I have completed.

 

I took the Basic I/O Rio Scan Mode VI that is found in the example finder under Hardware Input/Output.  In this, there are 4 input output channels that go to an array, which is displayed on the front panel.  The instructions are simple.  I placed the host VI on my computer.  I then deleted the 4 channels, and replaced them with the 4 channels of strain from our 9237 module and wire them accordingly.  (I added the CRIO device to the project before I added the channels to the diagram, so that part should be fine).  I set my number of scans, and when I run the program the front panel does not display anything, and stays in grid display like it has never ran. 

 

I need to take 4 channels of strain in scan mode and turn them into force in Newtons.  I think I can do the basic architecture (I have made several programs using other DAQ boards with Labview).  For some reason I cannot get the Compact Rio to take my strain values and give me force.  It doesn't act like it is doing anything, someone please help before I rip my hair out.  Thanks!   

 

0 Kudos
Message 2 of 8
(4,622 Views)

Hi MechHead,

The DAQ Assistant will not work with the NI cRIO. This is because the CompactRIO relies on the NI-RIO driver and is not a Multifunction DAQ device. This DeveloperZone explains the fundamental architecture necessary for cRIO communication, under “Real-Time Control Application Design”: NI CompactRIO – Reconfigurable Control and Acquisition System.

We must interact with our cRIO in the context of a LabVIEW Project. Have a look at a simple LabVIEW cRIO Project that I developed just for you:

 

2010-02-01_181519.png

 

I’ve used the Scan Engine Interface Mode to access the I/O on the NI-9237. Can you post a screenshot of your LabVIEW Project so I can see your architecture? Feel free to use mine as a reference.

I suspect that the issue may be that you have not deployed the code to your cRIO. Right-click the RT Controller name in your LabVIEW Project and select Deploy All. Now run your code. Do the indicators update with the data values?

Also, at what acquisition rate are you attempting to scan the modular I/O?

David G
Sales Engineer - SE Michigan & N Ohio
National Instruments
0 Kudos
Message 3 of 8
(4,608 Views)

Unfortunately I am not where the PC is that I am using for programming.  Can I see what your block diagram looks like for the host PC?  If you simply have a VI on the host PC and drag an input from the Rio chassis on to the block diagram for it, will it communicate at all?  Or is it always necessary to have a VI on the Rio as well? 

 

Also, in your program you have made the analog inputs of the 9237 into shared variables.  How do you make the connection from the VI on the Rio which has those to the host computer VI?  Drag and drop? 

 

I did use the "deploy all" method on the Rio to make sure everything was deployed.  I'll try again later this afternoon.  I am thinking I just have something wired wrong in the VI, but I don't know where.  Thanks for the help....

0 Kudos
Message 4 of 8
(4,597 Views)

Ok, so here is a little more info.  I used a basic Real Time program here built from an example.  This is a screen shot of my host VI, as well as the CRIO VI, and the project explorer as well.

 

This is pretty much the basic real time wizard set up for input/output (the one with the sine wave, which I got to work and display fine).  Can I not just drag and drop my input from the project explorer right into the VI on the compact rio?  This is what I did, and on the digital display my voltage stays the same.  Do I need another whole VI to aquire the strain and then give it to the CRIO VI?  (like the sine wave example).  Here is a screen shot of what I have.  I just cannot get the voltage from my strain gauge to display on the front panel.  Any help is appreciated, I'm half bald from all the hair I have pulled out.

 

Example.JPG

0 Kudos
Message 5 of 8
(4,584 Views)

Shoot, I posted the wrong picture.  Shortly after I realized when I made this program I didn't switch the variable to write in the acquire VI.  I switched accordingly, so that the acquire was write, and the host VI variable was read, so make that switch in your mind if you are looking at the above picture.  I tried again this morning and still cannot get my strain value to show up at all.

0 Kudos
Message 6 of 8
(4,560 Views)

Hi MechHead,

Let’s try adding some error handling to your existing VIs, so that we can better understand if there is a bigger problem. In your Real Time VI, pass the error wire into an Unbundle by Name function so that we can monitor the Status component of the Error Cluster. Wire this to an Or gate, and wire that output to the Conditional Terminal of the While Loop. Wire your Stop variable to the other Or gate terminal. Here is some code that describes visually what I just typed out:

 

errors.png

 

Finally, in your Host VI implement the same architecture. Additionally use the Simple Error Handler VI to observe the Status, Code and Source of any errors that may be occurring in your Windows host VI. What, if any, are the error codes/sources generated?

David G
Sales Engineer - SE Michigan & N Ohio
National Instruments
0 Kudos
Message 7 of 8
(4,556 Views)
After re-hardwiring everything I finally go signal to come through.  I never did get an error from the error handler, so I assume my programming was correct all along.  As far as wiring, I did not change how I wired stuff, I just re-completed the connections, so apparently this is what was causing my headaches.  If I have any further help I'll ask away, till then - hanks for the help!
0 Kudos
Message 8 of 8
(4,551 Views)