LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Initial Offset Storage

This is my first Labview app and I was denied the training course due to budget concerns, so this may be an elementary question.  I tried the online resources and could not make enough sense out of things to do what I need to do.
 
I am acquiring four load cell inputs from a CDaq system with a NI-9237 strain input module.  I am getting the information using the Daq Assistant, and then I am filtering the data.  I have graphs of the un-filtered and the filtered data, as well as a numeric display of the current filtered value.  I have hit a wall at the next step.  I need to capture a set of values (one for each channel - 4 total) at the same time (with a button on the front panel) to be stored as an offset for use in calculations.  I found an example that had a kind of similar activity, but I was unable to modify it to work for me. 
 
Once I have the offset values I would like to subtract this offset from the filtered values before graphing and display.  I will then use the compensated values in a formula to determine an induced force which I would like to display.  I will then write the 4 compensated values and the resulting induced force to a TDMS file for use later in Diadem.
 
Any help would be greatly appreciated.  Also please include any comment on the code that I am attaching because I may not be doing things very efficiently.
 
Thanks,
 
Wayne
 
 
0 Kudos
Message 1 of 4
(2,814 Views)
You said that you want to get these offsets "at the same time", but you also say that you want to do it based on a push button. What exactly does this mean? You have a loop set up so I'm assuming that you want to be collecting data all the time. Is this true? It seems to me that you're asking if you can asynchronous operation for the offset measurement. In other words, press a button, get the offsets. If not handling this operation, then go about collecting data. Be aware that you cannot perform two of the same type of data acquisition tasks at the same time with the same card. Your post title, though, implies that the offsets need to be acquired before data collection.

Also, what is your required data collection rate?
0 Kudos
Message 2 of 4
(2,803 Views)
By "at the same time" I mean that pressing the button will gather all four values from the current sample that is on the data line. 
 
The way I am currently doing things is that I have a loop that is continuously providing new information to the graphs and numeric displays.  When I am doing the final calculations manually in my shop I write down the 4 values (initial offset).  I then proceed to apply a static load, write down the 4 values (current load).  The load entered into my calculations is "current load - initial offset" for each of the 4 load cells.  I am essentially trying to automate the calculations because when I do the real experiment I will be in the cab of a truck going down a highway at speed acquiring information from the back of a loaded trailer pulling a second trailer.  During the experiment I will get the "initial offset" when the second trailer is not connected, which would be before I record any information to file.
 
The data collection rate is not known right now since I haven't looked at the signals while going down the road. 
 
I hope this makes a little more sense.
 
Wayne
0 Kudos
Message 3 of 4
(2,795 Views)
I think I understand a little better now. Since you're always reading the same channels you don't have to worry about dealing with different DAQ tasks. You will need to have a more structured program. I would suggest starting off with a state machine architecture, although you might find the producer-consumer architecture to be the most flexible. There are a number of functional and user requirements that you will need to define. For example:
  • Is there a possibility that the gathering of the offsets and the actual monitoring is separated in time by a lot, and could have a computer shutdown in between while the second trailer is connected?
  • Should the offsets be saved to file. When the program start up you will probably want to read the offsets from file so you have something to start with. These would be the last measured offsets, and may be valid ones to use. In essence, you would save the calibration values.
  • Do you need to have a human confirm the offsets to use? In other words, is there some "leveling off" of the values, so that you take the readings only when they've "settled"?
  • Data collection rate. This will need to be known fairly early on since it will impact your software architecture and data collection algorithm.
These are just a few things off the top of my head. Since you don't have that much experience with LabVIEW you may want to consider looking at local NI Alliance members who are experienced in dealing with these kinds of applications (both in terms of hardware and software). If you contact your local NI rep they can put you in touch with someone in your area.
0 Kudos
Message 4 of 4
(2,780 Views)