Hi list,
I just hit a problem that I worked around easily, but want to have some advice/better way/alternatives about.
I need to send commands in plain ascii to an appliance (an integrated servo motor) via comport. Say:
VT=1965093 (for target velocity)
By default, numbers over 100000 gets converted to scientific notation, so this is what gets sent:
VT=1.965093e+06
Of course the motor ignores the message.
I added a [makefilename %d] before the [print VT=$1( message and it does work well.
I was wondering if there's another way avoid scientific notation ?
Thanks,
On 09/28/13 17:17, Charles Goyard wrote:
Of course the motor ignores the message.
I added a [makefilename %d] before the [print VT=$1( message and it does work well.
the dollsym message [symbol VT=$1( is really *equivalent* to the object [makefilename VT=%g] with the latter potentially being faster.
dollargs don't evaluate particularily fast;
[makefilename %d] | [symbol VT=$1( is equivalent to [makefilename %d] | [makefilname VT=%s] which means that you have to do string-conversion two times.
if you want decent performance you should go directly:
[makefilename VT=%d] | [print $1(
(the $1-expansion in the last message is pretty fast, as '$1' is replaced directly with the atom without any fancy string stuff)
fmgadr IOhannes
Hi,
IOhannes m zmölnig wrote:
On 09/28/13 17:17, Charles Goyard wrote:
I added a [makefilename %d] before the [print VT=$1( message and it does work well.
if you want decent performance you should go directly:
[makefilename VT=%d] | [print $1(
(the $1-expansion in the last message is pretty fast, as '$1' is replaced directly with the atom without any fancy string stuff)
Nice one, thanks IOhannes !