[Emc-developers] trajectory section question

2011-03-31 Thread Chris Morley
Hi guys. I notice that in the Trajectory section of the manual there are entries: DEFAULT_VELOCITY DEFAULT_ACCELERATION MAX_VELOCITY MAX_ACCELERATION I referenced stepconf and it has: DEFAULT_VELOCITY MAX_LINEAR_VELOCITY DEFAULT_ANGULAR_VELOCITY MAX_ANGULAR_VELOCITY and does not enter a defau

Re: [Emc-developers] Right-justifying

2011-03-31 Thread Pavel Shramov
On Fri, Apr 01, 2011 at 01:13:54AM +0100, andy pugh wrote: > I am trying to put a signed 16 bit number into the rightmost 16 bits > of a u32 buffer. > However, surely there must be a tidier and faster way? (probably using > s16 typecasting and a bitwise OR? Yes, there is. u32_var = ((u32) (u16) s

[Emc-developers] Right-justifying

2011-03-31 Thread andy pugh
I am trying to put a signed 16 bit number into the rightmost 16 bits of a u32 buffer. I have something that nearly works: test = (analogue_out(0) < 0 ) ? 0x8000 | (u32)(analogue_out(0) * scale(0) * -3276.7) : 0x | (u32)(analogue_out(0) * scale(0) * 3276.7); (Though, unexpec