function rawvalue=getasraw(bag,val,fromunit)
% is used in generating units when the raw value is set for the first time
uns=bagarray.units;
rawunit=getrawunit(bag);

for i=1:length(uns)
    name=getname(uns{i});
    if strcmp(fromunit
        
        % todo
    end
end