Bug with TMCL command 135 (get application status)?

Bug with TMCL command 135 (get application status)?

Postby tmix » 28 Jun 2007, 16:23

I am using the command 135 with the TMCM-303 (Firmware V3.31). The TMCL documentation says
135 – get application status

one of these values is returned:
0 – stop
1 – run
2 – step
3 - reset

But when I read the value while the TMCL program runs, I get the value 16842752 (Datagram: 02 01 64 87 01 01 00 00) as return value. I get twice 01 and it is send as MSB. This is a bug, isn't it?
tmix
Power User
Power User
 
Posts: 20
Joined: 25 Sep 2006, 19:05

Use GGP 128 0 instead of command #135

Postby Andrew » 01 Jul 2007, 23:59

Trinamic once told me that only the lowest byte or a couple of bytes of value of reply are meaningful. The rest is junk coming from TMCL FirmWare.
Mind that TMCL datagram has a value field reversed - lowest byte goes first. By lowest byte I mean the least significant one.
So split the reply into 4 bytes and see which are meaningful discard the rest.

From your "datagram" it is not clear which bytes in value are least significant. because it is not clear what exactly you quote - the raw reply from controller with reversed value, or some display in TMCL-IDE with value straight?

You quote has 8 bytes instead of normal 9. Are you using CAN interface? But CAN has 7 bytes, if I remember well.

You can get the same information with global parameter #128. It is clean.
Andrew
 

Postby tmix » 02 Jul 2007, 11:22

I have tested it with my own software and the TMCL software.

I posted the bytes in the order as received (01 01 00 00).

The TMCL Reference Manual says on page 6 and 7 "Value: MSB first". So the MSB is 01, the next byte received is 01, the next byte is 00 and the LSB is 00. Both my software and the TMCL software display a value of 16842752.

Can I make that any clearer than that? When I write that I received the 01 as MSB, I usually mean just that.
tmix
Power User
Power User
 
Posts: 20
Joined: 25 Sep 2006, 19:05

Meaning of command #135

Postby Andrew » 02 Jul 2007, 13:50

Yes in TMCL MSB travels first.
But you still do not explain why there are 8 bytes quoted.

So, your status is "1 - run".

I will clarify myself. My previous message was specifically about command #135. Not about all commands.

Here is an excerpt from my documentation, which I attach to my own software:

Command #135 "Get application status". Returns 4 bytes (MSB,...,LSB).
MSB in Value field of reply is equivalent to "GGP 128,0":
  • 0 - stop
  • 1 - run
  • 2 - step
  • 3 - reset
The other 3 bytes return some additional information that will be needed by some future version of the TMCL-IDE software.

I don't remember if it is my own wording, or did I copy it from a private discussion with Trinamic.

Status byte being MSB rather than LSB explains why you get an awkward big number from the 4 bytes combined. You need to take just one highest byte.

One interesting feature of this command you may use right away. It is not for the future. It is already implemeted:
During an upload of a TMCL program, this command returns the address of next upload in the mentioned 3 redundant bytes. So you have one extra means of verifying the upload, or the absence of it.
Andrew
 


Return to Trinamic Motion Control Language (TMCL)

Who is online

Users browsing this forum: No registered users and 1 guest

cron