Writting Matlab code for t7 and a load cell | LabJack
 

Writting Matlab code for t7 and a load cell

8 posts / 0 new
Last post
Abosaad
abosaad's picture
Writting Matlab code for t7 and a load cell

I am trying to write a code for my school project. Currently we have two futek load cells and a labjack T7. We are having difficulty writing the code to properly acquire data from our load cells. We have downloaded the matlab DAQ library and have looked through the various general codes it supplies but we are not sure what code we should be using where.

Could anyone get us on the right track or point us in the direction of a good resource for us to get this DAQ system set up properly.

Thank you!

LabJack Support
labjack support's picture
Start by going through the

Start by going through the bridge circuit tutorial in post #13 here:

https://forums.labjack.com/index.php?showtopic=4376

Then, to read AIN0-AIN1 in matlab just use the eReadName example with name "AIN0" (assuming you did configuration in Kipling), or for an example including configuration look at SingleAINWithConfig.

 

Abosaad
abosaad's picture
Thanks for that link it

Thanks for that link it helped a lot. 

Now I am stuck on LJLogM, I have the white wire connected to AIN1, green to AIN0, black to GND and red to VS. I did change configuration in kipling to 0.01V for AIN0.

IN LJLog, for AIN0 the scaling equation y=a and scaled at 0.000016. AIN1 y=b scaled at 2.49. AIN2 y=c scaled at 0.08. AIN3 y=100*c/(0.01*a) scaled at 5*10^7.

Thank you again.

LabJack Support
labjack support's picture
Where exactly are you stuck

Where exactly are you stuck in LJLog?  What is not working as expected?

 

Abosaad
abosaad's picture
The amplitude starts big.

The amplitude starts big. There is something wrong with the scalling.

LabJack Support
labjack support's picture
What is the rated load of

What is the rated load of your load cell (e.g. 1000 pounds) and what is the rated output of your load cell (e.g. 2 mV/V)?

 

Abosaad
abosaad's picture
200-300 pounds and 2mV/V

200-300 pounds and 2mV/V

LabJack Support
labjack support's picture
Lets say your load cell has a

Lets say your load cell has a rating of 200 pounds and 2 mV/V.  That means that if your excitation is 5 volts, the load cell will output 10 mV at 200 pounds.  I suggest you start by putting on a known weight and confirm you get the expected voltage.

You said your load cell is connected to AIN0 and AIN1, so you want to take a differential reading of AIN0.

Lets say you have used Kipling to configure AIN0 as differential with a range of 0.1V and then saved that as the power-up default.  Then lets say you have the name "AIN0" in the first row of LJLogM (which is how it comes up by default).  Look at the voltage in this first row, and confirm it reads 0.005 volts for 100 pounds.

Now start with a simple scaling equation where you assume Vexcitation is 5.0 volts.  So if you use the equation y=(a/0.01)*200, and a is equal to 0.005, then the scaled value is 100.