LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB Acquisition problem

I'm having an issue with my the data I'm getting back from my VI. I'll first explain what I'm trying to do.

 

I'm using a MCC USB-1608FS DAQ module to acquire 4 analog channels: Horizontal Load, Horizontal Deform, Vertical Load and Vertical Deform. I'm also using a DigitalIn and DigitalOut. The DI is receiving a TTL signal from a MTS 407 controller. The DO is outputting a Run/Stop cmd to the MTS controller. The MTS run/stop controls a hydraulic pump which cycles a "sample/specimen" horizontally based off a defined frequency input from the user. The Load cell is attached to this hydraulic piston and is used to measure load from the material being tested.

 

My code does the following: 

 

Initialize State:    Sets the sample clock for 4 Analog channels

Idle State:          Acquires 4 analog channels and displays them on charts. When the Data button is pushed, it activates the Record State.

Record State:    Counts the TTL signal and on the first LOW TO HIGH, activates the digital output, which turns on the Run cmd for the MTS controller. This turns on the actuator for the pump and begins cycling the hydraulics. After this, the load cell voltage is looked at and is compared to the last reading taken in the Idle state. When the load cell voltage is increased by the defined spec, the Acquire State is activated.

Acquire State:     Counts TTL and stores it in memory and records data file.

 

My main objective here is to record data when the load cell reaches 20mV higher than it's "zero", or the initial reading before the pump starts.

 

The code works, but not as intended.

Lets say my initial load cell reading is 0.003(before the MTS run cmd is activated) and I start the pump and the piston starts cycling... I then probe the first reading coming from my load cell and it reads 0.03...ok fine. I assume I can't get any closer. But after I acquire my data, my first reading in the data file is 0.10-0.30. ??? I assume there's some delay here that I don't know how to mitigate. Does anyone have any suggestions from looking at my code? I would appreciate the help.

 

Kindly,

GLS

 

 

0 Kudos
Message 1 of 3
(2,109 Views)

Hi GLS,

 

There is some potential delay between the record state and the acquire state. After the record state determines the value is greater than .02 there are other lines of code/tasks within the record state that still may need to run before transitioning to the acquire state. Additionally, in the acquire state there are sections of code that could be executing prior to the analog read executing.

 

The range of values you are seeing, .1V-.3V, is most likely due to the varying code execution times we are encountering due to the uncertainty of when items in each state are occurring.

 

-Jake B.

Message 2 of 3
(2,056 Views)
apparently my Analog Read in the Acquire state did just that. I was initializing the read in both states. Guess that was enough to delay it. I've put the measurements portion of the vi in the Record state and deleted the Acquired state.
0 Kudos
Message 3 of 3
(2,051 Views)