Bosch 6000 User's Guide Page 63

  • Download
  • Add to my manuals
  • Print
  • Page
    / 268
  • Table of contents
  • TROUBLESHOOTING
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 62
48
6000 Series Programmer's Guide
QuickBASIC Source Code Example
(continued)
SUB createposition STATIC
'************************************************************************
' SUBPROGRAM : createposition
' PURPOSE : Manipulate the 4 bytes received from the fast status area into
' a position value. Only call createposition after calling readstatus.
' This function should only be called when reading commanded position
' or encoder position.
' REQUIRES : The 4 status bytes returned from readstatus - status1,
' status2, status3, status4.
' RETURNS : Position in global variable position#.
'************************************************************************
IF (status4 AND NEGATIVEMASK) THEN 'If negative take the two's complement
status4 = 255 - status4
status3 = 255 - status3
status2 = 255 - status2
status1 = 255 - status1
negvalue = 1
ELSE
negvalue = 0
END IF
highword# = status4 * 256# + status3 'Create high word (upper 2 bytes)
lowword# = status2 * 256# + status1 'Create low word (lower 2 bytes)
position# = highword# * 256# * 256# + lowword# 'Create position (4 bytes)
IF (negvalue = 1) THEN
position# = position# + 1 'Must add 1 for two's complement
position# = 0 - position# 'Value should be negative
END IF
END SUB
Customizing the
Fast Status
Register
The number of customizable blocks differs between servo and a stepper products:
AT6n50: You can customize status blocks 3-8 (blocks 1 & 2 may not be changed).
AT6n00: You can customize status blocks 7 & 8 (blocks 1-6 may not be changed).
The FASTAT command syntax is FASTAT<i>,<i>. In the first data field (“<i>”), enter the
number of the status block you wish to change. In the second data field, enter the number of
the content option (see table below). For example, the FASTAT5,6 command configures
block #5 to report the position error.
To check the current configuration of all blocks in the status area, type “FASTAT” followed
by a carriage return; the controller will respond with the current option number selected for
each block. To check the configuration of one block, type “FASTATi” (i = number of the
block in question) followed by a carriage return.
It takes one system update period to process the FASTAT command and re-configure the fast
status blocks. If using the AT6n50 (servos), refer to the table in the SSFR command
description to determine the system update period (affected by the SSFR and INDAX). For the
AT6n00 (steppers), one system update period is 2ms.
Page view 62
1 2 ... 58 59 60 61 62 63 64 65 66 67 68 ... 267 268

Comments to this Manuals

No comments