B&R Automation Studio Loadcell programming in C

sunshine2017

Member
Join Date
May 2017
Location
Prien
Posts
2
Hello,

I have used AGHscale() from B&R Automation Studio.


fbTestVar.enable=1;
fbTestVar.doTare=1;
fbTestVar.doStandardize1=1;
fbTestVar.t_measure=1;
fbTestVar.pWGHscalePara =(unsigned long int)&TestVar1;
TestVar1.ref1_raw=3000;
TestVar1.ref1_std=1000;


fbTestVar.doStandardize2=1;
TestVar1.ref2_raw=23700;
TestVar1.ref2_std=31500;


fbTestVar.raw_value=analogInput1;

WGHscale(&fbTestVar);

Above is the Code i used.
I have attached a screenshot with the Monitor values. As you can see its not doing the second Standardisation. What could be wrong?

screen.jpg
 
Okay, you're giving the function block 3 different calibration commands all at once and you already have the values those commands return filled in, so that's probably what your problem it.

You do Standardize1 with a known weight on the load cell and that known weight entered into TestVar1.ref1_std and the function returns TestVar1.ref1_raw. Repeat for a second known weight and Standardize2. Now you have a calibrated fbTestVar.std_value. Instead, you can do this manually by finding ref1_raw and ref2_raw on your own.

Then you Tare and the function block returns TestVar1.tare_std to let you know how far offset from the calibration zero point your output value is going to be showing. You can also find this manually.

It makes no sense to fire doTare, doStandardize1, and doStandardize2 all at once and no doubt is locking up the function block when you give it two different calibration weights with the same raw input creating a flat calibration line where all weights are possible with the one raw input.
 

Similar Topics

Hi, I have been trying to run drive via Sysmac studio. I can ping the drive. I can see the logic bits going on/off as per command. But, drive is...
Replies
21
Views
443
Hello Experts, I recently stumbled with an issue about ABB VFD ACS800 connected with B&R PLC X20CP1484-1. This ABB VFD ACS800 somehow got...
Replies
0
Views
298
Hi, I would like to prepare a project for the operator panel and I do it like this: New project -> I choose the appropriate panel -> add object ->...
Replies
0
Views
396
Hi, I would like to prepare a project for the operator panel and I do it like this: New project -> I choose the appropriate panel, it seems to me...
Replies
3
Views
591
Hi all, I am working with an IO link sensor (measuring current across motor)and need to read in and store the sensor values for 5 seconds, then...
Replies
13
Views
1,189
Back
Top Bottom