PFCMD PY

From DIDEAS Wiki
Revision as of 02:29, 29 November 2010 by Ceb (talk | contribs)
Jump to: navigation, search

PF Users Navigation:

Edit

user apps

do_command.py

do_command.py -h :

Options:
  -h, --help            show this help message and exit
  -i IP_ADDRESS, --ip_address=IP_ADDRESS
                        make a TCP connection to the specified IP (instead of
                        using serial)
  -P PORT, --port=PORT  port number for TCP connections.
  -c COM_PORT, -p COM_PORT, --com_port=COM_PORT
                        COM PORT number for serial port connection
  -b BAUDRATE, --baud_rate=BAUDRATE
                        baurdrate when using serial port (default is 115200)
  -g GET_TYPE           get IO channels : options are [ai, di, ao, do]
  --suffix=SPECIAL_COMMAND_SUFFIX
                        suffix for special commands (thus variations on the
                        special commands can be used.)
  -D REPEAT_DELAY, --delay=REPEAT_DELAY
                        special command repeat delay in milliseconds
  -v GET_VERSION, --version=GET_VERSION
                        execute the version command on each of the specified
                        platforms.  Eg -v smi does all platforms.
  -n REPEAT_COUNT, --repeat_count=REPEAT_COUNT
                        number of times to repeat the supplied special
                        command(s)
  -T, --set_time        use the PC time to set the robot clock
  -X, --hex_mode        display the special command results in hex
  -F, --float_mode      interpret the data from the special command as
                        floating point numbers
  -f LOG_FILE_NAME, --file_name=LOG_FILE_NAME
                        log the results to a file.
  -S STRUCT_STRING, --struct_string=STRUCT_STRING
                        use struct.unpack(STRUT_STRING, data) to process the
                        result of the special command.  Eg -S =10L
  -R READ_ADDRESS, --read_address=READ_ADDRESS
                        read memory from address (int or hex)
  -W WRITE_ADDRESS, --write_address=WRITE_ADDRESS
                        write data to address (int or hex)
  -d DATA_FILENAME, --data_filename=DATA_FILENAME
                        text file source for data that is written. file should
                        contain numbers (UINT8_T) separated with a char from
                        [,;:= ].  these numbers will be turned into a
                        bytestream for use with memory write.
  -L READ_LENGTH, --read_length=READ_LENGTH
                        length of memory buffer to read
  -M MEMORY_TYPE, --memory_type=MEMORY_TYPE
                        numeric code to specify the memory type and platform
                        for read and write.  Use -H for a list.
  -s, --special         -s N [arg1, ... ] issue special command N with
                        arguments.  Args may be negative, and multiple
                        commands may be issued by repeating the -s
  -V, --write_data      list of SPACE separated values available for memory
                        write command.  Eg -V 1 2 3
  -H, --memory_type_help
                        list the ID numbers for various robot memory types.
 HOSTCMD_SC_RAM_MEM_TYPE              1   
 HOSTCMD_SC_FLASH_MEM_TYPE            2
 HOSTCMD_SC_MFG_EEPROM_MEM_TYPE       3
 HOSTCMD_SC_USR_EEPROM_MEM_TYPE       4
 HOSTCMD_MC_RAM_MEM_TYPE              5   
 HOSTCMD_MC_FLASH_MEM_TYPE            6
 HOSTCMD_IMU_RAM_MEM_TYPE             11
 HOSTCMD_IMU_FLASH_MEM_TYPE           12
 HOSTCMD_IMU_MFG_EEPROM_MEM_TYPE      13
 HOSTCMD_IMU_USR_EEPROM_MEM_TYPE      14

examples

  • Using two special commands, each 10 times to read the SC and MC state:

do_command.py -p <COM PORT> -n 10 -s 104 -s 1420

  • Read IMU data and display as a float:

do_command.py -p <COM PORT> -F -s 2025

  • Read IMU and run through a strut string to produce 4 ints, 4 longs, and 4 floats (length = 40)

do_command.py -p <COM PORT> -S =4h4L4F -s 2030

  • Read 512 bytes of IMU FLASH memory at address 4096:

do_command.py -p <COM PORT> -L 0x200 -R 0x1000 -M 12

  • Write 3 bytes ('A','B','C') to SC USR EEPROM at address 0xff0, then read it back

do_command.py -p <COM PORT> -W 0xff0 -V 65 66 67 -M 4 -R 0xff0

  • Write a list of numbers from a file to SC USR_EEPROM

do_command.py -p <COM PORT> -W 0xff0 -d eeprom_data.txt -M 4 -R 0xff0